User Interface Help Reference

This reference section provides topics that are available from the user interface by pressing the F1 key or by clicking Help in wizard steps and dialog boxes. Topics for wizards are grouped by wizard. Dialog boxes are grouped under the Dialog Boxes topic.


Cube Wizard

Helps you build a multidimensional cube from relational data. After you build and process the cube, you can browse its data in the Cube browser. If you do not process the cube, you will see sample data in the Cube browser.

The Cube wizard appears when you right-click the Cubes folder in the tree view of the OLAP Manager or right-click an existing cube, point to New Cube, and then click Wizard.

The Cube wizard has the following steps:

  • Select the data source and fact table for your cube.
  • Define the measures for your cube.
  • Select the dimensions for your cube.
  • Name and save your cube.
  • Use the Cube editor to further define your cube.


Cube Wizard - Introduction

The Cube wizard takes you through the creation of a cube: selecting the data source, fact table, measures, and dimensions for a new cube.

To start the Cube wizard, right-click the Cubes folder in the OLAP Manager tree view, point to New Cube, and then click Wizard.

For more information about cubes, see Cubes in the Administrator’s Guide.

Options

Skip this screen in the future

Select this option to bypass the wizard introductory screen the next time you start the wizard. If you select this option, you can return to the introductory screen in the future by clicking Back in the second step of the wizard.

Next

Choose this option to go to the next step of the wizard.

Cancel

Choose this option to cancel the completion of the wizard and return to the OLAP Manager.

Help

Choose this option to view this Help topic.


Cube Wizard - Select a Fact Table

In this step of the wizard, you select a fact table. A fact table contains the numeric data that cube users want to analyze.

The wizard displays a list of data sources that are currently available. Click the “+” to expand the data source and view the tables contained within. If no data source is visible or you want to define one, click New Data Source to define the data source.

Select a primary fact table for the cube from one of the tables in a data source listed under Data sources and tables. When you select a table, its columns appear under Details.

Options

New Data Source

Choose this option to define a new data source. For more information about selecting a data source, click Help in the Data Link Properties dialog box.

Browse Data

Choose this option to preview the contents of the table you have selected.


Cube Wizard - Define Measures

In this step of the wizard, you choose the numeric columns that you want to use as measures for the cube. The numeric columns available are listed under Fact table numeric columns.

For more information about measures, see Measures.

To define your measures

  • Click columns under Fact table numeric columns. Use the buttons provided to move measures to the list under Cube measures.

    To add a numeric column as a measure to a cube, click the column, and then click “>“ (Add).

    To remove a selected cube measure from a cube, click the measure, and then click “<“ (Remove).

    To add all displayed numeric columns as measures to a cube, click “>>“ (Add All).

    To remove all measures from a cube, click “<<“ (Remove All).


Cube Wizard - Select Dimensions

In this step of the wizard, you choose dimensions for the cube. You can choose from previously-defined dimensions (which are “shared,” that is, available to other cubes) or start the Dimension wizard to create a new dimension. If you create a new dimension, you can define it as either “shared” or “private” (available only to the cube you are creating).

The previously-defined dimensions available are listed under Shared dimensions.

For more information about dimensions, see Dimensions.

To select dimensions

  • Select dimensions under Shared dimensions. Use the buttons provided to move dimensions to the list under Cube dimensions.

    To add a shared dimension to a cube, click the dimension, and then click “>“ (Add).

    To remove a cube dimension from a cube, click the dimension, and then click “<“ (Remove).

    To add all available shared dimensions to a cube, click “>>“ (Add All).

    To remove all dimensions from a cube, click “<<“ (Remove All).

Options

New Dimension

Choose this option to start the Dimension wizard, which helps you create a new dimension.


Cube Wizard - Finish

In this step of the wizard, you name and save the cube. You can also review the structure of the cube.

For more information about cubes, see Cubes.

To name your cube

  • Type a unique name in the Cube name box. You can enter a maximum of 50 characters for the cube name. A cube name must begin with a letter of the alphabet.

You can review the measures and dimensions of the cube under Cube structure.

Options

Browse Sample Data

Choose this option to open the Cube browser and view sample data in the dimensions and measures of the cube. You cannot browse your actual data until you have processed the cube.

Note This option will be disabled if you have been directed to create joins manually in the Cube editor.


Dimension Wizard

Helps you create shared and private dimensions for your cube.

For more information about dimensions, see Dimensions.

The Dimension wizard appears when you click New Dimension in the Select Dimensions step of the Cube wizard.

An alternative way to start the Dimension wizard is to expand the Library folder under your database in the OLAP Manager tree view, right-click the Shared Dimensions folder, point to New Dimension, and then click Wizard. If you start the Dimension wizard in this way, you can create only shared dimensions.

The Dimension wizard has the following steps:

  • Choose whether you want to use a single table or multiple tables for your dimension.
  • Select the table or tables for your dimension.
  • Define your dimension as either a standard or time dimension.
  • Select the levels for your dimension.
  • Name your dimension and preview its data.


Dimension Wizard - Introduction

The Dimension wizard takes you through the creation of a dimension for your cube.

In this step of the wizard, you specify whether your new dimension will be created from one table or from multiple tables.

To start the Dimension wizard, open the Library folder under your database in the OLAP Manager tree view, right-click the Shared Dimensions folder, point to New Dimension, and then click Wizard. This option allows you to create shared dimensions only.

The Dimension wizard also appears when you click New Dimension in the Select Dimensions step of the Cube wizard.

For more information about dimensions, see Dimensions.

Options

A single dimension table (flat or star schema)

Creates a dimension based on a star schema, that is, a single table structure. The dimension will be derived from a single table that joins to the fact table. In a cube with a star schema, all dimension tables join to the fact table.

Multiple dimension tables (snowflake schema)

Creates a dimension based on a snowflake schema, that is, multiple joined tables. The dimension will be derived from multiple joined tables; one will join to the fact table. In a cube with a snowflake schema, one or more dimension tables join to another dimension table, not the fact table.

Next

Choose this option to go to the next step of the wizard.

Cancel

Choose this option to cancel the completion of the wizard and return to the OLAP Manager.

Help

Choose this option to view this Help topic.


Dimension Wizard - Select Dimension Table

In this step of the wizard, you select the table or tables from which you want to create your dimension. If you select multiple tables, all the tables must come from the same data source.

Under Available tables, the wizard displays a list of the tables in your data source that are available for creating dimensions. Click the “+” to expand the data source and view the tables contained within.

If you do not see the table you want to use for the dimension, choose another data source. If you do not find the table you want under any of the data sources shown, click New Data Source to establish another connection.

To view the data in a table

  1. Under Available tables, click the table whose data you want to view.
  2. Click Browse Data.

To select a dimension table for a star schema (single table)

  1. Under Available tables, select the table you want to add. The columns of that table appear under Details.
  2. Click Next.

To select dimension tables for a snowflake schema (multiple tables)

  1. Under Available tables, click the tables you want to use. Use the buttons provided to move tables to the list under Selected tables.

    To add a table to the list, click the table, and then click “>“ (Add).

    To remove a table from the list, click the table, and then click “<“ (Remove).

    To add all displayed tables to your list, click “>>“ (Add All).

    To remove all tables from your list, click “<<“ (Remove All).

  2. Click Next.

Note All the tables you select must come from the same data source. If you add a table from a data source that is different from that of the other selected tables, the list of tables under Selected tables will be cleared.


Dimension Wizard - Select the Dimension Type

This step of the wizard appears only if, in the Select Dimension Table step, you selected a table that contains both date-formatted columns and columns of other formats. In this step, you specify the type of dimension you want to create.

Options

Standard dimension

Select this option to create a standard categorical dimension, rather than a time dimension.

Time dimension

Select this option to create a time dimension based on a date-formatted column.

If you click Time dimension, you must select the date-formatted column from the Date column list.


Dimension Wizard - Create Time Dimension Levels

This step appears only if you are creating a time dimension. In this step, you select the levels for your time dimension. You can also specify a start date for your year.

To select time dimension levels

  • Under Select time levels, click the date levels you want in your time dimension. These levels are created from the date-formatted column you selected in the previous step of the wizard.

    You can preview the level structure under Dimension structure.

To specify a start date for your year

  1. Under Day, specify the day you want the year to start.
  2. Under Month, specify the month you want the year to start.


Dimension Wizard - Edit Joins

This step appears only if you clicked Multiple dimension tables (snowflake schema) in the introductory step of the wizard, indicating that you would use more than one table for your dimension.

In this step of the wizard, you can create, edit, and remove joins between your dimension tables. The wizard displays the tables you have selected for your dimension. If two or more tables share a column, the wizard shows that it has automatically created a join by showing a line connecting the matching columns.

Note The Dimension wizard is designed for use with simple schemas. If you are designing a complex snowflake schema, it is recommended that you use the Dimension editor.

If you need to edit joins but do not have a mouse or pointing device, cancel the Dimension wizard and create the dimension with the Dimension editor, which provides the Join command on the Insert menu and the Remove Join command on the Edit menu.

To create a join

  1. Click the column that you want to base the join on.
  2. Drag that column to the column in another table with which you want to join the first column. You can join only columns of compatible data types.

To remove a join

  1. Right-click the line that represents the join.
  2. Click Remove.

To reposition the tables on the screen

  • Click the table title bar and drag the table to the location you want.

To change the size of a table on the screen

  • Drag an edge or corner of the table window.


Dimension Wizard - Select Levels

In this step of the wizard, you can define certain columns as levels in your dimension. The columns you can use appear under Available columns.

The default setting in this step allows for members of a selected level to be counted. This is required for cube processing. It may take some time to process levels with a large number of members. To speed up the dimension creation process, clear the Count level members automatically check box. If automatic counting of level members is turned off, you must manually enter an estimated number for levels using the Properties pane in the Dimension editor or respond to individual prompts during cube processing.

For more information about dimension levels, see Defining Dimensions.

To select levels

  1. Under Available columns, click the columns you want to use. Use the buttons provided to move columns to the list under Dimension levels.

    To add a column to the list, click the column, and then click “>“ (Add).

    To remove a level from the list, click the level, and then click “<“ (Remove).

    To add all displayed columns to your list, click “>>“ (Add All).

    To remove all levels from your list, click “<<“ (Remove All).

  2. Use the Move Level Up and Move Level Down buttons to arrange your levels in the order you want.
  3. Click Next.

Note Your levels must appear in hierarchical order beginning with the most general level of detail. For example, a Geography dimension would be ordered World (All), Continents, Countries, Cities.


Dimension Wizard - Finish

In this final step of the wizard, you can name your dimension and preview the dimension data. If you started the Dimension wizard from the Cube wizard, you can also choose whether you want this to be a shared dimension or a private dimension.

To name your dimension

  • In the Dimension name box, type a unique name for your new dimension. You can enter a maximum of 24 characters for the dimension name, which must begin with an alphabetic character.

To preview your dimension data

  • Use the Preview box to preview the hierarchy of your dimension.

Options

Share this dimension with other cubes

This option is available only if you started the Dimension wizard from the Cube wizard. Select it if you want your dimension to be available to other cubes. If you choose to save this dimension as a shared dimension, the dimension will appear in the Shared Dimensions folder under the Library folder in the tree view of the OLAP Manager.

If you started the Dimension wizard from the shortcut menu of a Shared Dimensions folder, your dimension will be shared automatically.


Incremental Update Wizard

Helps you update a partition in your cube with new data from a data source.

Caution This wizard updates a partition. Incorrect use of partitions can result in inaccurate cube data. For more information, see Partitions and its subtopics in the Administrator’s Guide.

To start the wizard

  1. In the OLAP Manager tree view, right-click your cube, and then click Process.
  2. In the Process a Cube dialog box, click Incremental update, and then click OK.

The Incremental Update wizard has the following steps:

  • Select a partition to update.
  • Specify the data source and the fact table.
  • Create a filter expression.
  • Update the partition in your cube.


Incremental Update Wizard - Introduction

The Incremental Update wizard helps you add new data to an existing cube partition. The wizard creates a temporary partition from the new data and merges it into an existing partition.

Caution This wizard updates a partition. Incorrect use of partitions can result in inaccurate cube data. For more information, see Partitions and its subtopics in the Administrator’s Guide.

Running the wizard is appropriate when new data has been added to the data warehouse, but existing data has not changed, and you want to add the new data to your cube. The wizard adds the new data and associated aggregations but does not process changes to the cube’s structure.

To start the wizard

  1. In the OLAP Manager tree view, right-click your cube, and then click Process.
  2. In the Process a Cube dialog box, click Incremental update, and then click OK.

Options

Skip this screen in the future

Choose this option to bypass the wizard’s introductory step the next time you start the wizard. If you choose this option, you can return to the introductory step in the future by clicking Back in the second step of the wizard.

Next

Choose this option to go to the next step of the wizard.

Cancel

Choose this option to cancel the completion of the wizard and return to the OLAP Manager.

Help

Choose this option to view this Help topic.


Incremental Update Wizard - Select Partition

Caution This wizard updates a partition. Incorrect use of partitions can result in inaccurate cube data. For more information, see Partitions and its subtopics in the Administrator’s Guide.

This step of the wizard appears only if the cube you are updating contains more than one partition. Because you can update only one partition at a time, you must select the one you want to update.

To select a partition to update

  • In the Partition box, select the partition you want to update from the drop-down list.


Incremental Update Wizard - Specify Data Source and Fact Table

Caution This wizard updates a partition. Incorrect use of partitions can result in inaccurate cube data. For more information, see Partitions and its subtopics in the Administrator’s Guide.

In this step of the wizard, you select the data source and fact table that contain the new data to add to your partition. The data source and fact table already used by the partition are displayed by default. If they also contain the new data you are adding, click Next.

You can select a data source and/or fact table different than those already used by the partition.

If you select a different data source, it must contain a fact table with the same structure and columns as the partition’s fact table, and it must contain dimension tables with the same structure and columns as the partition’s dimension tables. The wizard displays the required dimension tables.

If you select a different table, it must have the same structure and columns as the partition’s fact table. You must also manually merge the table with the partition's fact table after the incremental update completes. For more information, see Fact Table Considerations when Merging Partitions.

To change the data source and/or fact table

  1. Click Change.
  2. In the Choose a Fact Table dialog box, under Tables, expand the desired data source, select a fact table, and then click OK.


Incremental Update Wizard - Create Filter Expression

You can use a filter expression (WHERE clause expression) to update your partition with only a subset of the data in the fact table.

Caution If in the preceding step of the wizard, you selected the default fact table (that is, the same table already used as the partition’s fact table), you must use a filter expression to ensure that only data not already in the partition is added. Otherwise, the cube containing the partition will contain duplicate and therefore inaccurate data.

For example, the partition contains data for years 1995 through 1997. You are adding data for 1998 from the same table that supplies the 1995 through 1997 data. The name of the column that contains years is the_year. You must use the following filter expression:

"the_year"=1998

Another example (alphanumeric data):

"the_month"='January'

Whenever necessary to avoid ambiguity, use a qualified expression. For example, if a column name appears in multiple tables, include the table name in the expression:

"time"."the_month"='January'

The SELECT statement used to retrieve records for the incremental update is generated automatically by the wizard. The filter expression is connected with an AND to the automatically generated part of the WHERE clause. Therefore, if you specify multiple filter expressions, enclose them all in a pair of parentheses. Example:

("the_year"=1998 OR "the_year"=1999)

Filters consist of one or more expressions using columns in the fact table. A filter can also contain columns in dimension tables if they are included in a nested SELECT statement and the underlying database supports nested SELECT statements. For more information, see Filters.

The filter expression acts as a pass-through statement, and its syntax is not checked until you finish the wizard. If the syntax is incorrect, the incremental update fails.

To create a filter expression

  • Type a WHERE clause expression. Do not type WHERE.


Incremental Update Wizard - Finish

Caution This wizard updates a partition. Incorrect use of partitions can result in inaccurate cube data. For more information, see Partitions and its subtopics in the Administrator’s Guide.

In this final step of the wizard, click Finish to begin the incremental update of the partition with the new data. Depending on the size of the fact table, this operation may take a long time.


Partition Wizard

Helps you separate one logical cube into separate physical partitions so that you can enhance flexibility in data storage and location of data sources and improve query performance. The wizard also helps you add partitions to cubes.

Caution It is possible to create partitioned cubes that contain incorrect data. For more information, see Partitions and its subtopics in the Administrator’s Guide.

Note User-defined partitions are available only if you install Microsoft® SQL Server™ OLAP Services, Enterprise Edition.

The Partition wizard appears when you expand your cube in the OLAP Manager tree view, right-click the Partitions folder, and then click New Partition.

The Partition wizard has the following steps:

  • Specify the data source and fact table for the partition.
  • Select a data slice, or subset of cube data, to be stored in the partition (optional).
  • Final step:
    • Name your partition.
    • Specify filters (WHERE clause expressions) and/or set the aggregation prefix.
    • Start the Storage Design wizard to design your partition’s aggregations (optional) or copy the aggregation design of another partition.
    • Save your partition.
    • Process your partition (optional).


Partition Wizard - Introduction

The Partition wizard helps you separate one logical cube into separate physical partitions so that you can enhance flexibility in data storage and location of data sources and improve query performance. The wizard also helps you add partitions to cubes.

Caution It is possible to create partitioned cubes that contain incorrect data. For more information, see Partitions and its subtopics in the Administrator’s Guide.

You can partition data on different servers (using multiple data sources). This approach provides parallel query processing for one cube across a cluster of servers.

You can also separate data into multiple partitions on a single server (using a single data source). This approach enables you to fine-tune your cube by specifying different data storage modes (MOLAP, ROLAP, or HOLAP) and designing different aggregations for each partition.

To start the Partition wizard, expand your cube in the OLAP Manager tree view, right-click the Partitions folder, and then click New Partition.

Options

Skip this screen in the future

Choose this option to bypass the wizard’s introductory step the next time you start the wizard. If you choose this option, you can return to the introductory step in the future by clicking Back in the second step of the wizard.

Next

Choose this option to go to the next step of the wizard.

Cancel

Choose this option to cancel the completion of the wizard and return to the OLAP Manager.

Help

Choose this option to view this Help topic.


Partition Wizard - Specify Data Source and Fact Table

Caution It is possible to create partitioned cubes that contain incorrect data. For more information, see Partitions and its subtopics in the Administrator’s Guide.

In this step of the wizard, you select the data source and fact table for your partition. The data source and fact table used by the cube are displayed by default. If they also contain the data for your partition, click Next.

You can select a data source and/or fact table different than those used by the cube.

If you select a different data source, it must contain fact and dimension tables with the same structure and columns as the cube’s data source. The wizard displays the required dimension tables.

If you select a different fact table, it must have the same structure and columns as the cube’s fact table

To change the data source and/or fact table

  1. Click Change.
  2. In the Choose a Fact Table dialog box, under Tables, expand the desired data source, select a fact table, and then click OK.


Partition Wizard - Select Data Slice

Caution It is possible to create partitioned cubes that contain incorrect data. For more information, see Partitions and its subtopics in the Administrator’s Guide.

In this optional step of the wizard, you can specify a subset, or slice, of the data in your cube to use as the partition data. To bypass this step, click Next.

Under Dimensions is a two-column box. All the dimensions in the cube appear in the Name column. The Data slice column shows the member you select for each dimension. The data slice is defined by all the dimension members you select.

To select a data slice

  1. In the Name column, click a dimension by which to define the data slice.
  2. Under Members, expand members to reveal other members, and then click the member to define the data slice. The member appears in the Data slice column.
  3. To remove a dimension member from the data slice, click the dimension name, and then press the Delete key.
  4. Repeat the preceding steps until you select all the members that define the data slice, and then click Next.


Partition Wizard - Finish

Caution It is possible to create partitioned cubes that contain incorrect data. For more information, see Partitions and its subtopics in the Administrator’s Guide.

In this final step of the wizard, you can name your partition, choose aggregation design options, and specify advanced settings for your partition. You can also process your new partition when the wizard finishes.

Caution If in a previous step you selected the default fact table (that is, the same fact table used by the cube), you must use a filter to ensure that each partition in the cube includes mutually exclusive data. Otherwise, the cube containing the partition will contain duplicate and therefore inaccurate data. To create a filter, click Advanced.

To name your partition

  • In the Partition name box, type a name that is unique in the database. You can enter a maximum of 50 characters.

Options

Design the aggregations for your partition now

Choose this option to start the Storage Design wizard when you click Finish.

Design the aggregations later

Choose this option to save your partition now and design aggregations later.

Copy the aggregation design from an existing partition.

Choose this option to copy the aggregation design from another partition to your new partition. In the Copy from box, select the partition from which to copy the aggregation design.

Note If in the future you might merge the new partition with another, copy the aggregation design of the other partition. To be merged, partitions must have the same structure and aggregation design.

Process the partition when finished

Choose this option if you want to process the new partition when you click Finish. This option is not available if you choose Design the aggregations for your partition now.

Advanced

Click Advanced to add a filter (WHERE clause expression) or to change the aggregation prefix. The Advanced Settings dialog box is displayed. For more information, click Help in the Advanced Settings dialog box.


Storage Design Wizard

Helps you specify data storage and query performance options for the aggregations on a cube or partition.

For more information about data storage and aggregations, see Storing Cubes and Aggregations.

The Storage Design wizard appears when you expand the Cubes folder in the OLAP Manager tree view, right-click an existing cube, and then click Design Storage.

This wizard also appears when you expand the Partitions folder for an existing cube, right-click an existing cube partition, and then click Design Storage.

The Storage Design wizard has the following steps:

  • Select the type of data storage for your cube or partition (MOLAP, ROLAP, or HOLAP).
  • Design aggregations for your cube or partition based on aggregation storage size and query performance options.
  • Save your aggregations.
  • Process your cube or partition with the aggregations.


Storage Design Wizard - Introduction

Storage Design Wizard – Introduction

Helps you specify data storage and query performance options for the aggregations on a cube or partition.

For more information about data storage and aggregations, see Storing Cubes and Aggregations.

Options

Skip this screen in the future

Select this option to bypass the wizard introductory screen the next time you start the wizard. If you select this option, you can return to the introductory screen in the future by clicking Back in the second step of the wizard.

Next

Choose this option to go to the next step of the wizard.

Cancel

Choose this option to cancel the completion of the wizard.

Help

Choose this option to view this Help topic.


Storage Design Wizard - Select a Partition

This step of the wizard appears only if you started the wizard on a cube and it contains multiple partitions. You can run the wizard on only one partition at a time, so you must select the desired partition.

Options

Partition

Select the partition for which to design aggregations and choose storage options.


Storage Design Wizard - Aggregations Already Exist

This step of the wizard appears only if there are previously-designed aggregations for your cube or partition. The screen contains information about the existing data storage and aggregation settings.

Settings

Data storage type

Displays the data storage type used in this cube partition.

Aggregation storage space

Displays the existing storage space used by the previously-designed aggregations in this cube partition.

Number of aggregations

Displays the number of aggregations that have been previously designed for this cube partition.

Options

Replace the existing aggregations

Select this option to completely replace the existing aggregations with new ones you design. To use new aggregations, you must reprocess the cube after aggregation design.

Add new aggregations to the existing ones

Select this option to append new aggregations to the existing ones. You must reprocess the cube before you can use combined aggregations for this cube partition.


Storage Design Wizard - Select Data Storage

In this step of the wizard, you specify the type of data storage you want to use to store the data and aggregations for a cube or partition.

For more information about data storage choices, see Flexible Data Model.

Options

MOLAP

Select MOLAP (multidimensional OLAP) to store the data for your cube or partition in a multidimensional structure. The aggregations you design for this storage type will also be stored with the multidimensional data.

MOLAP storage provides the potential for the most rapid query response times, depending only on the percentage and design of the cube's aggregations. In general, MOLAP is more appropriate for cubes with frequent use and the necessity for rapid query response.

ROLAP

Select ROLAP (relational OLAP) to keep the data for your cube or partition in the existing relational data store. Aggregations designed for ROLAP will also be stored in the relational database, rather than in a multidimensional structure.

ROLAP query response is generally slower than that available with the other two options. A typical use of ROLAP is for large data sets that are infrequently queried, such as historical data from less recent previous years.

HOLAP

Select HOLAP (hybrid OLAP) to keep the data for your cube or partition in the existing relational data store and your aggregations in a multidimensional structure.

For queries that access summary data, HOLAP is the equivalent of MOLAP. Queries that access base data, such as a drill-down to a single fact, must retrieve data from the relational database and will not be as fast as if the base data were stored in the MOLAP structure. Cubes stored as HOLAP are smaller than equivalent MOLAP cubes and respond faster than ROLAP cubes for queries involving summary data. HOLAP storage is generally suitable for cubes that require rapid query response for summaries based on a large amount of base data.


Storage Design Wizard - Set Aggregation Options

In this step of the wizard, you set options for storage and performance to design the aggregations for the cube or partition.

In designing your cube, you will have to balance the storage needs of the aggregation tables against the speed and performance of the queries. There are three approaches to achieving this balance:

  • Set the storage size and let Microsoft® SQL Server™ OLAP Services determine which aggregations to store. This approach works well when you have limited storage space.
  • Set the percentage of performance gain and let the necessary aggregation tables take as much storage space as they need.
  • Manually determine the best balance by watching the progress of the Performance vs. Size graph.

Aggregation Options

Select the option you want for aggregation design.

Estimated storage reaches

Enter the amount of hard disk storage to allocate for storing the aggregation tables. You can enter a maximum storage size in either megabytes (MB) or gigabytes (GB).

Performance gain reaches

Specify the percentage amount of performance gain for your queries. This amount represents the percentage improvement between the maximum and minimum query times, as represented by the formula:

PercentGain = 100 * (QTimeMAX - QTimeTARGET) / (QTimeMAX - QTimeMIN)

For example, if an unoptimized query takes twenty-two seconds (QTimeMAX) to execute, and the best possible query performance with maximum aggregations is two seconds (QTimeMIN), specify a 75% desired performance gain to achieve a query time of seven seconds (QTimeTARGET).

Until I click Stop

Select this option to manually control the balance. Watch the Performance vs. Size graph to determine when the increase in performance levels off even though storage continues to build.

Start

Click Start to begin designing aggregations based on the options you have selected.

Stop

Click Stop to manually halt the aggregation design process.

Reset

Click Reset to delete any aggregations you have just added and restart aggregation design.


Storage Design Wizard - Finish

In this step of the wizard, you save the aggregations. You can process the cube as you save the aggregations or process it at a later time. If you are designing several cubes, you can postpone processing and process them all at once.

For more information about processing cubes, see Processing Cubes.

Options

Process now

Select this option to save the designed aggregations for the cube or partition and process the cube. The new aggregations will be available for use by queries sent to the cube only after processing is completed.

Note If you choose to process the cube now, the Process dialog box appears in which you can view the progress of the operation.

Save, but don’t process now

Select this option if you want to save the newly-designed aggregations for the cube or partition, but you want to delay cube processing to a later time. Your new aggregations will not be available for use by queries sent to the cube until processing is completed.


Usage Analysis Wizard

Helps you generate an on-screen report analyzing the query usage of your cube.

The Usage Analysis wizard appears when you right-click a cube in the OLAP Manager tree view and then click Usage Analysis.

The Usage Analysis wizard has the following steps:

  • Select a report type.
  • Select the criteria to filter your report.
  • View the results.


Usage Analysis Wizard - Introduction

The Usage Analysis wizard helps you set criteria to analyze the queries sent to your cube. You can choose from a variety of reports to analyze:

  • Query run time
  • Frequency of queries
  • Users and the queries they have sent
  • Distribution of query response time
  • Total number of queries processed by hour or by date

Select one of these six reports to display query usage analysis on-screen:

  • Query Run-Time Table: A table showing the run time of queries, ordered from the longest to the shortest run time.
  • Query Frequency Table: A table showing the frequency of queries, ordered from the most to the least frequent.
  • Active User Table: A table showing users and the number of queries they have sent. Queries are ordered from the most to least queries sent per user.
  • Query Response Graph: A bar graph showing the response time for all queries.
  • Query By Hour Graph: A bar graph showing the total number of queries processed, grouped by hour.
  • Query By Date Graph: A bar graph showing the total number of queries sent, grouped by date.

Options

Next

Choose this option to go to the next step of the wizard.

Cancel

Choose this option to cancel the completion of the wizard and return to the OLAP Manager.

Help

Choose this option to view this Help topic.


Usage Analysis Wizard - Select Filter Criteria

In this step of the wizard, you set criteria to analyze query usage. A query log contains information about the queries that have been sent to your cube. You apply filters to this log to determine the specifics of your report. Available filter criteria include time period, users, query duration, and query frequency.

This step is optional. If you select no filter criteria in this step, the wizard will return a report on all queries. If you want to skip this step, click Next.

To filter your report by a specific time period

  1. Select the Queries for the dates check box.
  2. Select Between, Before, or After.
  3. Click the “…” button to select dates for one or both date boxes.
  4. Click Next.

To filter your report by one or more specific users

  1. Select the Queries by these users check box.
  2. Use the Add and Remove buttons to build your list of users.
  3. Click Next.

Note You cannot filter by users unless you have defined user roles. For more information about roles, see Roles.

To filter your report by length of query

  1. Select the Queries that took longer than check box.
  2. In the second box, select Seconds or Minutes.
  3. In the first box, type or select a number.
  4. Click Next.

To filter your report by frequency of query

  1. Select the Queries that ran more than check box.
  2. Type or select a number in the times box.
  3. Click Next.

To base your report on more than one filter criterion

  1. Select all the options you want to include.
  2. Fill in the details for each option.
  3. Click Next.


Usage Analysis Wizard - Review Results

In this final step of the wizard, you can view your report. It cannot be saved. The title on this page reflects the report choice you made in the first step of the wizard.

Options

Delete Records

Choose this option if you want to delete from the query log the queries analyzed for your report.


Usage-Based Optimization Wizard

Helps you tune performance of cube partitions based on the history of queries previously sent to the cube.

For more information about optimizing performance, see Scalability.

The Usage-Based Optimization wizard appears when you right-click an existing cube in the OLAP Manager tree view and then click Usage-Based Optimization.

The Usage-Based Optimization wizard has the following steps:

  • Select the cube partition whose query performance you want to optimize.
  • Select the queries on which you want to base your optimization.
  • Review the results.
  • Choose whether to replace existing aggregations or to add new ones.
  • Select a type of data storage.
  • Design new aggregations.
  • Save and process the new aggregations.


Usage-Based Optimization Wizard - Introduction

The Usage-Based Optimization wizard helps you optimize the aggregations for your cube partitions based on the queries that have been previously sent to your cube.

To start the Usage-Based Optimization wizard, right-click an existing cube in the OLAP Manager tree view, and then click Usage-Based Optimization.

Options

Skip this screen in the future

Select this option to bypass the wizard introductory screen the next time you start the wizard. If you select this option, you can return to the introductory screen in the future by clicking Back in the second step of the wizard.

Next

Choose this option to go to the next step of the wizard.

Cancel

Choose this option to cancel the completion of the wizard and return to the OLAP Manager.

Help

Choose this option to view this Help topic.


Usage-Based Optimization Wizard - Select Partition

This step of the wizard appears only if your cube has multiple partitions. In this step, you select the partition for which you want to optimize performance. You can perform this operation on only one partition at a time.

To select a partition

  • Click the down arrow to select a partition from the list, and then click Next.


Usage-Based Optimization Wizard - Select Queries

In this step of the wizard you select the queries you want to base your optimization on. You can specify:

  • Queries between two dates
  • Queries by specific users
  • Length of time that a query takes to return a result set
  • Numbers of times a query has been run
  • Queries sent to one of the specific data storage types used in your cube
  • A combination of any number of the above

To base your optimization on all the queries that ran during a specific time period

  1. Select the Queries for the dates check box.
  2. Select Between, Before, or After.
  3. Click the “…” button to select dates for one or both date boxes.
  4. Click Next.

To base your optimization on queries by one or more specific users

  1. Select the Queries by these users check box.
  2. Use the Add and Remove buttons to build your list of users.
  3. Click Next.

To base your optimization on all the queries of a certain duration

  1. Select the Queries that took longer than check box.
  2. In the second box, select Seconds or Minutes.
  3. In the first box, type or select a number.
  4. Click Next.

To base your optimization on queries that ran a certain number of times

  1. Select the Queries that ran more than check box.
  2. Type or select a number in the times box.
  3. Click Next.

To base your optimization on queries to data stored in a specific mode

  1. Select the Queries to check box.
  2. Click MOLAP cubes, ROLAP tables, or The server cache. The server cache option bases optimization on queries that were resolved solely by accessing the memory of the server computer without accessing a storage device.
  3. Click Next.

To base your optimization on more than one query criterion

  1. Select all the options you want to include.
  2. Fill in the details for each option.
  3. Click Next.


Usage-Based Optimization Wizard - Review Results

In this step of the wizard, you can view the queries that match the options you have specified for optimization of your cube partition. A status bar near the bottom of the screen displays the number of matching queries found. These results will be used to optimize future queries.

Reports

Request Dataset Description

Displays information on the data requested by each matching query.

Times Executed

Displays the number of times each matching query had been sent to the cube.

Average Duration

Displays the average duration of each matching query.


Usage-Based Optimization Wizard - Aggregations Already Exist

This step of the wizard appears only if there are previously designed aggregations for your cube or partition. Information appears on the screen about the existing data storage and aggregation settings.

Settings

Data storage type

Displays the data storage type used in this cube partition.

Aggregation storage space

Displays the existing storage space used by the previously designed aggregations in this cube partition.

Number of aggregations

Displays the number of aggregations previously designed for this cube partition.

Options

Replace the existing aggregations

Select this option to completely replace the existing aggregations with new ones you design. Before you can use your new aggregations, you must reprocess the cube.

Add new aggregations to the existing ones

Select this option to append new aggregations to the existing ones. You must reprocess the cube to use combined aggregations for this cube partition.


Usage-Based Optimization Wizard - Select Data Storage

In this step of the wizard, you specify the type of data storage you want to use to store the data and aggregations for your cube or partition.

For more information about data storage, see Flexible Data Model and Storing Cubes and Aggregations.

Options

MOLAP

Select MOLAP (multidimensional OLAP) to store the data for your cube or partition in a multidimensional structure. The aggregations you design for this storage type will also be stored with the multidimensional data.

MOLAP storage provides the potential for the most rapid query response times, depending only on the percentage and design of the cube's aggregations. In general, MOLAP is more appropriate for cubes with frequent use and the necessity for rapid query response.

ROLAP

Select ROLAP (relational OLAP) to keep the data for your cube or partition in the existing relational data store. The aggregations you design for this storage type will also be stored in the relational database, rather than in a multidimensional structure.

ROLAP query response is generally slower than that available with the other two options. A typical use of ROLAP is for large datasets that are infrequently queried, such as historical data from less recent previous years.

HOLAP

Select HOLAP (hybrid OLAP) to keep the data for your cube or partition in the existing relational data store and your aggregations in a multidimensional structure.

For queries that access summary data, HOLAP is the equivalent of MOLAP. Queries that access base data, such as a drill-down to a single fact, must retrieve data from the relational database and will not be as fast as if the base data were stored in the MOLAP structure. Cubes stored as HOLAP are smaller than equivalent MOLAP cubes and respond faster than ROLAP cubes for queries involving summary data. HOLAP storage is generally suitable for cubes that require rapid query response for summaries based on a large amount of base data.


Usage-Based Optimization Wizard - Set Aggregation Options

In this step of the wizard, you set options for storage and performance to design the aggregations for your cube or partition.

In designing your cube, you will have to balance the storage needs of your aggregation tables against the speed and performance of your queries. There are three approaches to achieving this balance:

  • Set the storage size and let Microsoft® SQL Server™ OLAP Services determine which aggregations to store. This approach works well when you have limited storage space.
  • Set the percentage of performance gain you want and let the necessary aggregation tables take as much storage space as they need.
  • Manually determine the best balance by watching the progress of the Performance vs. Size graph.

Aggregation Options

Estimated storage reaches

Enter the amount of hard disk storage you want to allocate for storing the aggregation tables. You can enter a maximum storage size in either megabytes (MB) or gigabytes (GB).

Performance gain reaches

Specify the percentage amount of performance gain for your queries. This amount represents the percentage improvement between the maximum and minimum query times, as represented by the formula:

PercentGain = 100 * (QTimeMAX - QTimeTARGET) / (QTimeMAX - QTimeMIN)

For example, if an unoptimized query takes twenty-two seconds (QTimeMAX) to execute, and the best possible query performance with maximum aggregations is two seconds (QTimeMIN), specify a 75% desired performance gain to achieve a query time of seven seconds (QTimeTARGET).

Until I click Stop

Select this option to manually control the balance. Watch the Performance vs. Size graph to determine when the increase in performance levels off even though storage continues to build.

Start

Click Start to begin designing aggregations based on the options you have selected.

Stop

Click Stop to manually halt the aggregation design process.

Reset

Click Reset to delete any aggregations you have just added and restart aggregation design.


Usage-Based Optimization Wizard - Finish

In this step of the wizard, you save the aggregations. You can process the cube as you save the aggregations or process it at a later time. If you are designing several cubes, you can postpone processing and process them all at once.

For more information about processing cubes, see Processing Cubes.

Options

Process now

Select this option to save the designed aggregations for the cube or partition and process the cube. The new aggregations will be available for use by queries sent to the cube only after processing is completed.

Note If you choose to process the cube now, the Process dialog box appears in which you can view the progress of the operation.

Save, but don’t process now

Select this option if you want to save the newly-designed aggregations for the cube or partition, but you want to delay cube processing to a later time. Your new aggregations will not be available for use by queries sent to the cube until processing is completed.


Virtual Cube Wizard

Helps you create a virtual cube, a superset of selected cubes in your database. Virtual cubes allow you to create a broader view of your multidimensional data without storing additional data in a physical storage space on your drive.

For more information about virtual cubes, see Virtual Cubes.

The Virtual Cube wizard appears when you expand your database in the OLAP Manager tree view, right-click the Virtual Cubes folder, and then click New Virtual Cube.

The Virtual Cube wizard has the following steps:

  • Select the cubes in your database that you want to include in your virtual cube.
  • Select the measures for your virtual cube.
  • Select the dimensions for your virtual cube.
  • Name and save your virtual cube.


Virtual Cube Wizard - Introduction

The Virtual Cube wizard helps create a virtual cube. You select the cubes that you want to include in the virtual cube, and then you select the specific measures and dimensions that you want to use in the virtual cube.

Options

Skip this screen in the future

Select this option to bypass the wizard introductory screen the next time you start the wizard. If you select this option, you can return to the introductory screen in the future by clicking Back in the second step of the wizard.

Next

Choose this option to go to the next step of the wizard.

Cancel

Choose this option to cancel the completion of the wizard and return to the OLAP Manager.

Help

Choose this option to view this Help topic.


Virtual Cube Wizard - Select Cubes

In this step of the wizard, you select the cubes from your database that you want to add to your virtual cube.

To select cubes for the virtual cube

  • Click cubes under Available cubes. Use the buttons provided to move cubes to the list under Virtual cube includes.

    To add a cube, click the cube, and then click “>“ (Add).

    To remove a selected cube from a virtual cube, click the cube, and then click “<“ (Remove).

    To add all the displayed cubes to a virtual cube, click “>>“ (Add All).

    To remove all cubes from a virtual cube, click “<<“ (Remove All).


Virtual Cube Wizard - Select Measures

In this step of the wizard, you add measures to your virtual cube. The measures that are available for your virtual cube are listed under Available measures.

To select measures for the virtual cube

  • Click measures under Available measures. Use the buttons provided to move measures to the list under Selected measures.

    To add a measure, select it and then click “>“ (Add).

    To remove a selected measure, select it and then click “<“ (Remove).

    To add all the displayed measures, click “>>“ (Add All).

    To remove all measures from a virtual cube, click “<<“ (Remove All).


Virtual Cube Wizard - Select Dimensions

In this step of the wizard, you add dimensions to your virtual cube. The dimensions that are available for your virtual cube are listed under Available dimensions.

Dimension availability is based on the measures you have selected for your virtual cube. Only the dimensions from cubes that contain your selected measures are available to your virtual cube. If the Available dimensions list does not contain a dimension that you want to add, make certain that you have selected a measure from the cube containing that dimension.

To select dimensions for the virtual cube

  • Click dimensions under Available dimensions. Use the buttons provided to move dimensions to the list under Selected dimensions.

    To add a dimension, click it and then click “>“ (Add).

    To remove a selected dimension, click it and then click “<“ (Remove).

    To add all the displayed dimensions, click “>>“ (Add All).

    To remove all dimensions from a virtual cube, click “<<“ (Remove All).


Virtual Cube Wizard - Finish

In this final step of the wizard, you name the virtual cube.

To name the virtual cube

  • In the Virtual cube name box, type a name unique to the database for the new virtual cube. You can enter a maximum of 50 characters for the virtual cube name. The name must begin with an alphabetic character.

Options

Process now

Select this option to process the virtual cube when you click Finish. If the structure of a component cube has changed since the last time it was processed, the cube is processed along with the virtual cube; component cube processing may take considerable time.

Note If you choose to process the virtual cube now, the Process dialog box appears in which you can view the progress of the operation.

Save and don’t process now

Select this option to postpone virtual cube processing to a later time. You must process the virtual cube before it can be used.


Virtual Dimension Wizard

Helps you create a virtual dimension.

The Virtual Dimension wizard appears when you expand the Library folder, right-click the Virtual Dimensions folder, and then click New Virtual Dimension.

The Virtual Dimension wizard has the following steps:

  • Select a member property on which the virtual dimension will be based.
  • Name and save your virtual dimension.


Virtual Dimension Wizard - Introduction

The Virtual Dimension wizard takes you through the creation of a virtual dimension.

The main benefits of virtual dimensions are storage savings and reduced cube processing time. Aggregation data for virtual dimensions is not stored. It is calculated in memory. Therefore, if you add a virtual dimension to a cube, its storage usage and processing time do not increase as when you add an ordinary dimension.

Virtual dimensions are also used to display information from a single dimension on opposing axes. This type of presentation is helpful to users who want to cross reference dimension members with attributes of those members. These attributes are called member properties and are the basis for defining virtual dimensions.

For example, a user requests to analyze Production by cross referencing Factory Name and Factory Type. If the Location dimension already contains Factory Name and the Location dimension table contains a Factory Type column, add Factory Type as a member property and create a virtual dimension from it. After you add the virtual dimension to the cube, the user can cross reference Factory Names and Factory Types and compare the Production values at the intersections.

A member property must be created before its associated virtual dimension. For more information, see Creating Member Properties in the Administrator’s Guide.

For more information about virtual dimensions, see Virtual Dimensions in the Administrator’s Guide.

The Virtual Dimension wizard appears when you expand the Library folder, right-click the Virtual Dimensions folder, and then click New Virtual Dimension.

Options

Skip this screen in the future

Choose this option to bypass the wizard introductory step the next time you start the wizard. If you choose this option, you can return to the introductory step in the future by clicking Back in the second step of the wizard.

Next

Choose this option to go to the next step of the wizard.

Cancel

Choose this option to cancel the completion of the wizard and return to the OLAP Manager.

Help

Choose this option to view this Help topic.


Virtual Dimension Wizard - Select Member Property

In this step of the wizard, you select from an existing dimension the member property on which the virtual dimension will be based.

You may add a virtual dimension to a cube only if the dimension supplying the member property is also included in the cube.

To select a member property for the virtual dimension

  1. In the Member properties box, expand the dimensions to display available member properties.
  2. Click the member property on which the virtual dimension will be based.
  3. Click Next.


Virtual Dimension Wizard - Finish

In this final step of the wizard, you name and save the virtual dimension.

To name and save the virtual dimension

  1. In the Virtual dimension name box, type a name for your new virtual dimension. You can enter a maximum of 24 characters.
  2. Click Finish.


Dialog Boxes

This reference section provides topics that are available from the user interface by pressing F1 or by clicking Help. Help topics for wizards are provided in other sections under the names of the wizards.


Advanced Settings Dialog Box

Caution It is possible to create partitioned cubes that contain incorrect data. For more information, see Partitions and its subtopics in the Administrator’s Guide.

This dialog box enables you to:

  • Create a filter (WHERE clause expression) that limits the data used to create the partition.
  • Change the prefix for the aggregation names.

This dialog box is displayed when you click Advanced in the Convert to Partition dialog box or the last step of the Partition wizard.

Filter statement

Type a filter expression (WHERE clause expression of an SQL SELECT statement) to limit the data used to create the partition. Do not type WHERE.

Important One use of filter expressions is to ensure that all partitions in a cube contain mutually exclusive data. Otherwise, the cube will contain duplicate and therefore inaccurate data. When you write a filter expression for this purpose, ensure that it excludes data already in the cube’s partitions.

For example, a cube contains three partitions, one for each year 1995, 1996, and 1997. You are creating a new partition for 1998 from the same table that supplies the data for the other partitions. The name of the column that contains years is the_year. You must use the following filter expression:

"the_year"=1998

Another example (alphanumeric data):

"the_month"='January'

Whenever necessary to avoid ambiguity, use a qualified expression. For example, if a column name appears in multiple tables, include the table name in the expression:

"time"."the_month"='January'

The SELECT statement used to retrieve records for the creation of the partition is generated automatically. The filter expression is connected with an AND to the automatically-generated part of the WHERE clause. Therefore, if you specify multiple filter expressions, enclose them all in a pair of parentheses, for example:

("the_year"=1998 OR "the_year"=1999)

Filters consist of one or more expressions using columns in the fact table. A filter can also contain columns in dimension tables if they are included in a nested SELECT statement and the underlying database supports nested SELECT statements. For more information, see Filters.

The filter expression acts as a pass-through statement, and its syntax is not checked until you process the partition. If the syntax is incorrect, processing fails.

Aggregation prefix

Specify the prefix used for the partition’s aggregation names.


Calculated Member Builder

Enables you to add calculated members to a cube.

Note For information about the standard OLAP functions, see Function List.

This dialog box appears whenever you do one of the following from the Cube editor:

  • On the Insert menu, click Calculated Member.
  • Click the Insert Calculated Member button on the toolbar.
  • In the tree view, right-click either the Calculated Members folder or a calculated member, and then click New Calculated Member.
  • In the tree view, right-click a calculated member, and then click Edit.

Parent dimension

Expand the drop-down list and select the dimension from which this calculated member is to be derived.

Parent member

If you select a parent dimension other than Measures, the Change button will be enabled. Click Change, and then select a parent member.

Member name

The name of this calculated member. For example, “Average Sale.”

Register

Register an external function type library (*.olb, *.tlb, *.dll). The new library will appear in the Functions box for your use.

Value expression

Build the calculated member’s expression using the data members in the Data box and the functions in the Functions box. The Data box contains the cube’s dimensions, measures and existing calculated members. The Functions box contains the standard OLAP function library plus any additional libraries that have been registered by previous users. For information about the standard OLAP functions, see Function List.

Note Using the Data and Functions boxes provides a powerful and convenient means for building valid value expressions. You can also type an expression directly into the Value expression box.

To add a function to the value expression

  1. Place the pointer where you want the function inserted in the Value expression box.
  2. Select the desired function in the Functions box.
  3. Click Insert (located above the calculator pad).

This action places a copy of the function syntax in the Value expression box. Replace any arguments with the appropriate expressions.

Example

To manually enter a calculated member that finds the average profit margin by store, which is defined as 1 - Store Cost/Store Sales, enter the following in the Value expression box:

  • Type “1-”.
  • In the Data box, expand the Measures | MeasuresLevel member to display the individual measure columns.
  • Select Store Cost.
  • Click Insert.
  • In the Value expression box, place the pointer at the end of the phrase that was just entered, and then type a “/”.
  • In the Data list box, select Store Sales.
  • Click Insert.

    The following expression will appear in the Value expression box:

    1-[Measures].[Store Cost]/[Measures].[Store Sales]

  • In the Member Name box, type “Average Store Margin”.
  • Click OK.


Function List

Return to: Calculated Member Builder

Usage Notes

  • Null keyword

    You can use the keyword Null to create a calculated member whose value is null.

  • Solve Order

    When you create a calculated member, you can specify an integer value for its Solve Order property in the Advanced tab of the Properties pane. This property specifies a priority for solving formulas, zero being the highest priority. The order of solving formulas becomes an issue for cells at intersections where two or more formulas are involved and the result depends on the order in which the formulas are solved. For example, if a formula for Annual Growth is presented in columns and Performance is presented in rows, the cell at the intersections can mean Annual Growth of Performance or Performance of Annual Growth, depending on which formula is solved first.

  • Temporary alias for a set

    A set in a function can be given a temporary alias for use within the function by using the keyword As. In this example, the set {State} is given the temporary alias S1 so it can be referred to later in the function in a nested iteration.

    Sum({State} As S1, Sum(Geography.CurrentMember.Children,
    Population * Val((Geography.CurrentMember.Properties("CityTax")) +
    Val(S1.Current.Properties("StateTax")))))

  • Sample set for examples

    For many expression examples in the following sections, SampleSet is defined to be the following:

    {USA, Buffalo, France, NYC, London, California, LA, Nice, UK, Paris}

    with sales data as indicated in the following table.

Location | 1995 sales | 1996 sales
UK | 1900 | 1700
London | 250 | 300
France | 2500 | 2500
Paris | 365 | 250
Nice | 27 | 100
USA | 5000 | 6500
NYC | 900 | 1100
Buffalo | 300 | 200
California | 2000 | 3500
LA | 500 | 900

ARRAY FUNCTIONS

Function | Syntax | Description
SetToArray | SetToArray(«Set»[, «Set»]...[, «Numeric Expression»]) | Converts one or more sets to an array for use in a user-defined function.

DIMENSION FUNCTIONS

Function | Syntax | Description
Dimension | «Hierarchy».Dimension | Returns the dimension that contains a specified hierarchy.
Dimension | «Level».Dimension | Returns the dimension that contains a specified level.
Dimension | «Member».Dimension | Returns the dimension that contains a specified member.
Dimensions | Dimensions(«Numeric Expression») | Returns the dimension whose zero-based position within the cube is specified by a numeric expression.
Dimensions | Dimensions(«String Expression») | Returns the dimension whose name is specified by a string.

HIERARCHY FUNCTIONS

Function | Syntax | Description
Hierarchy | «Level».Hierarchy | Returns a level's hierarchy.
Hierarchy | «Member».Hierarchy | Returns a member's hierarchy.

LEVEL FUNCTIONS

Function | Syntax | Description
Level | «Member».Level | Returns a member's level.
Levels | «Dimension».Levels («Numeric Expression») | Returns the level whose position in a dimension is specified by a numeric expression.
Levels | Levels(«String Expression») | Returns the level whose name is specified by a string expression.

LOGICAL FUNCTIONS

Function | Syntax | Description
IsEmpty | IsEmpty(«Value Expression») | Determines if an expression evaluates to the empty cell value.

MEMBER FUNCTIONS

Function | Syntax | Description
Ancestor | Ancestor(«Member», «Level») | Returns the ancestor of a member at a specified level.
ClosingPeriod | ClosingPeriod([«Level»[, «Member»]]) | Returns the last sibling among the descendants of a member at a level.
Cousin | Cousin(«Member1», «Member2») | Returns the member with the same relative position under a member as the member specified.
Current Member | «Dimension».Current Member | Returns the current member along a dimension during an iteration.
Default Member | «Dimension».Default Member | Returns the default member of a dimension.
FirstChild | «Member».FirstChild | Returns the first child of a member.
FirstSibling | «Member».FirstSibling | Returns the first child of the parent of a member.
Item | «Tuple».Item(«Numeric Expression») | Returns a member from a tuple.
Lag | «Member».Lag(«Numeric Expression») | Returns a member prior to the specified member along the member's dimension.
LastChild | «Member».LastChild | Returns the last child of a member.
LastSibling | «Member».LastSibling | Returns the last child of the parent of a member.
Lead | «Member».Lead(«Numeric Expression») | Returns a member further along the specified member's dimension.
Members | Members(«String Expression») | Returns the member whose name is specified by a string expression.
NextMember | «Member».NextMember | Returns the next member in the level that contains a specified member.
OpeningPeriod | OpeningPeriod([«Level»[, «Member»]]) | Returns the first sibling among the descendants of a member at a level.
ParallelPeriod | ParallelPeriod([«Level»[, «Numeric Expression»[, «Member»]]]) | Returns a member from a prior period in the same relative position as a specified member.
Parent | «Member».Parent | Returns the parent of a member.
PrevMember | «Member».PrevMember | Returns the previous member in the level that contains a specified member.
ValidMeasure | ValidMeasure(«Tuple») | Returns a valid measure in a virtual cube by forcing inapplicable dimensions to their top level.

NUMERIC FUNCTIONS

Function | Syntax | Description
Aggregate | Aggregate(«Set»[, «Numeric Expression»]) | Returns a calculated value using the appropriate aggregate function, based on the context of the query.
Avg | Avg(«Set»[, «Numeric Expression»]) | Returns the average value of a numeric expression evaluated over a set.
CoalesceEmpty | CoalesceEmpty(«Numeric Expression»[, «Numeric Expression»]...) | Coalesces an empty cell value to a number.
Correlation | Correlation(«Set», «Numeric Expression»[, «Numeric Expression»]) | Returns the correlation of two series evaluated over a set.
Count | Count(«Set»[, EXCLUDEEMPTY | INCLUDEEMPTY]) | Returns the number of tuples in a set, empty cells included unless the optional EXCLUDEEMPTY flag is used.
Covariance | Covariance(«Set», «Numeric Expression»[, «Numeric Expression»]) | Returns the covariance of two series evaluated over a set (biased).
CovarianceN | CovarianceN(«Set», «Numeric Expression»[, «Numeric Expression»]) | Returns the covariance of two series evaluated over a set (unbiased).
IIf | IIf(«Logical Expression», «Numeric Expression1», «Numeric Expression2») | Returns one of two numeric values determined by a logical test.
LinRegIntercept | LinRegIntercept(«Set», «Numeric Expression»[, «Numeric Expression»]) | Calculates the linear regression of a set and returns the value of b in the regression line y = ax + b.
LinRegPoint | LinRegPoint(«Numeric Expression», «Set», «Numeric Expression»[, «Numeric Expression»]) | Calculates the linear regression of a set and returns the value of y in the regression line y = ax + b.
LinRegR2 | LinRegR2(«Set», «Numeric Expression»[, «Numeric Expression»]) | Calculates the linear regression of a set and returns R2 (the coefficient of determination).
LinRegSlope | LinRegSlope(«Set», «Numeric Expression»[, «Numeric Expression»]) | Calculates the linear regression of a set and returns the value of a in the regression line y = ax + b.
LinRegVariance | LinRegVariance(«Set», «Numeric Expression»[, «Numeric Expression»]) | Calculates the linear regression of a set and returns the variance associated with the regression line y = ax + b.
Max | Max(«Set»[, «Numeric Expression»]) | Returns the maximum value of a numeric expression evaluated over a set.
Median | Median(«Set»[, «Numeric Expression»]) | Returns the median value of a numeric expression evaluated over a set.
Min | Min(«Set»[, «Numeric Expression»]) | Returns the minimum value of a numeric expression evaluated over a set.
Ordinal | «Level».Ordinal | Returns the zero-based ordinal value associated with a level.
Rank | Rank(«Tuple», «Set») | Returns the one-based rank of a tuple in a set.
Stddev | Stddev(«Set»[, «Numeric Expression»]) | Alias for Stdev.
StddevP | StddevP(«Set»[, «Numeric Expression»]) | Alias for StdevP.
Stdev | Stdev(«Set»[, «Numeric Expression»]) | Returns the standard deviation of a numeric expression evaluated over a set (unbiased).
StdevP | StdevP(«Set»[, «Numeric Expression»]) | Returns the standard deviation of a numeric expression evaluated over a set (biased).
Sum | Sum(«Set»[, «Numeric Expression»]) | Returns the sum of a numeric expression evaluated over a set.
Value | «Measure».Value | Returns the value of a measure.
Var | Var(«Set»[, «Numeric Expression»]) | Returns the variance of a numeric expression evaluated over a set (unbiased).
Variance | Variance(«Set»[, «Numeric Expression»]) | Alias for Var.
VarianceP | VarianceP(«Set»[, «Numeric Expression»]) | Alias for VarP.
VarP | VarP(«Set»[, «Numeric Expression»]) | Returns the variance of a numeric expression evaluated over a set (biased).

SET FUNCTIONS

Function | Syntax | Description
AddCalculated
Members 		AddCalculatedMembers
(«Set») 		Adds calculated members to a set.
BottomCount | BottomCount(«Set», «Count»[, «Numeric Expression»]) | Returns a specified number of items from the bottom of a set, optionally ordering the set first.
BottomPercent | BottomPercent(«Set», «Percentage», «Numeric Expression») | Sorts a set and returns the bottom N elements whose cumulative total is at least a specified percentage.
BottomSum | BottomSum(«Set», «Value», «Numeric Expression») | Sorts a set and returns the bottom N elements whose cumulative total is at least a specified value.
Children | «Member».Children | Returns the children of a member.
Crossjoin | Crossjoin(«Set1», «Set2») | Returns the cross product of two sets.
Descendants | Descendants(«Member», «Level»[, «Desc_flag»]) | Returns the set of descendants of a member at a specified level, optionally including or excluding descendants in other levels.
Distinct | Distinct(«Set») | Eliminates duplicate tuples from a set.
DrilldownLevel DrilldownLevel(«Set»[, «Level»])
or
DrilldownLevel(«Set», , «Index») 		Drills down the members of a set, at a specified level, to one level below.

Alternatively, drills down on a specified dimension in the set.
DrilldownLevelBottom DrilldownLevelBottom
(«Set», «Count»[, [«Level»][, «Numeric Expression»]]) 		Drills down the bottom N members of a set, at a specified level, to one level below.
DrilldownLevelTop DrilldownLevelTop
(«Set», «Count»[, [«Level»][, «Numeric Expression»]]) 		Drills down the top N members of a set, at a specified level, to one level below.
Drilldown
Member 		DrilldownMember
(«Set1», «Set2»[, RECURSIVE]) 		Drills down the members in a set that are present in a second specified set.
Drilldown
MemberBottom 		DrilldownMemberBottom(«Set1», «Set2», «Count»[, [«Numeric Expression»][, RECURSIVE]]) Like DrilldownMember except that it includes only the bottom N children.
Drilldown
MemberTop 		DrilldownMemberTop
(«Set1», «Set2», «Count»[, [«Numeric Expression»][, RECURSIVE]]) 		Like DrilldownMember except that it includes only the top N children.
DrillupLevel | DrillupLevel(«Set»[, «Level»]) | Drills up the members of a set that are below a specified level.
DrillupMember | DrillupMember(«Set1», «Set2») | Drills up the members in a set that are present in a second specified set.
Except | Except(«Set1», «Set2»[, ALL]) | Finds the difference between two sets, optionally retaining duplicates.
Extract | Extract(«Set», «Dimension»[, «Dimension»...]) | Returns a set of tuples from extracted dimension elements. The opposite of Crossjoin.
Filter | Filter(«Set», «Search Condition») | Returns the set resulting from filtering a set based on a search condition.
Generate | Generate(«Set1», «Set2»[, ALL]) | Applies a set to each member of another set and joins the resulting sets by union.
Head | Head(«Set»[, « Numeric Expression »]) | Returns the first specified number of elements in a set.
Hierarchize | Hierarchize(«Set») | Orders the members of a set in a hierarchy.
Intersect | Intersect(«Set1», «Set2»[, ALL]) | Returns the intersection of two input sets, optionally retaining duplicates.
LastPeriods | LastPeriods(«Index»[, «Member»]) | Returns a set of members prior to and including a specified member.
Members | «Dimension».Members | Returns the set of all members in a dimension.
Members | «Hierarchy».Members | Returns the set of all members in a hierarchy.
Members | «Level».Members | Returns the set of all members in a level.
Mtd | Mtd([«Member»]) | A shortcut function for the PeriodsToDate function that specifies the level to be Month.
Order | Order(«Set», {«String Expression» | «Numeric Expression»}[, ASC | DESC | BASC | BDESC]) | Arranges members of a set, optionally preserving or breaking the hierarchy.
PeriodsToDate | PeriodsToDate([«Level»[, «Member»]]) | Returns a set of periods (members) from a specified level starting with the first period and ending with a specified member.
Qtd | Qtd([«Member»]) | A shortcut function for the PeriodsToDate function that specifies the level to be Quarter.
StripCalculatedMembers StripCalculatedMembers
(«Set») 		Removes calculated members from a set.
StrToSet | StrToSet(«String Expression») | Constructs a set from a string expression.
Subset | Subset(«Set», «Start»[, «Count»]) | Returns a subset of elements from a set.
Tail | Tail(«Set»[, «Count»]) | Returns a subset from the end of a set.
ToggleDrillState | ToggleDrillState(«Set1», «Set2»[, RECURSIVE]) | Toggles the drill state of members. This function is a combination of DrillupMember and DrilldownMember.
TopCount | TopCount(«Set», «Count»[, «Numeric Expression»]) | Returns a specified number of items from the top of a set, optionally ordering the set first.
TopPercent | TopPercent(«Set», «Percentage», «Numeric Expression») | Sorts a set and returns the top N elements whose cumulative total is at least a specified percentage.
TopSum | TopSum(«Set», «Value», «Numeric Expression») | Sorts a set and returns the top N elements whose cumulative total is at least a specified value.
Union | Union(«Set1», «Set2»[, ALL]) | Returns the union of two sets, optionally retaining duplicates.
VisualTotals | VisualTotals(«Set», «Pattern») | Dynamically totals child members specified in a set using a pattern for the total label in the result set.
Wtd | Wtd([«Member»]) | A shortcut function for the PeriodsToDate function that specifies the level to be Week.
Ytd | Ytd([«Member»]) | A shortcut function for the PeriodsToDate function that specifies the level to be Year.

STRING FUNCTIONS

Function | Syntax | Description
CoalesceEmpty | CoalesceEmpty(«String Expression»[, «String Expression»]...) | Coalesces an empty cell value to a string.
IIf | IIf(«Logical Expression», «String Expression1», «String Expression2») | Returns one of two string values determined by a logical test.
Name | «Dimension».Name | Returns the name of a dimension.
Name | «Hierarchy».Name | Returns the name of a hierarchy.
Name | «Level».Name | Returns the name of a level.
Name | «Member».Name | Returns the name of a member.
SetToStr | SetToStr(«Set») | Constructs a string from a set.
TupleToStr | TupleToStr(«Tuple») | Constructs a string from a tuple.
UniqueName | «Dimension».UniqueName | Returns the unique name of a dimension.
UniqueName | «Level».UniqueName | Returns the unique name of a level.
UniqueName | «Member».UniqueName | Returns the unique name of a member.

TUPLE FUNCTIONS

Function | Syntax | Description
Current | «Set».Current | Returns the current tuple from a set during an iteration.
Item | «Set».Item(«String Expression»[, «String Expression»...] | «Index») | Returns a tuple from a set.
StrToTuple | StrToTuple(«String Expression») | Constructs a tuple from a string.


AddCalculatedMembers

Return to: Calculated Member Builder Function List

Adds calculated members to a set.

Syntax

AddCalculatedMembers(«Set»)

Remarks

This function includes only the calculated members that are siblings in the set.

Example

In the above diagram, the following functions return the following values.

Function | Returns
AddCalculatedMembers({GrandParent.Children}) | {[Parent 1],[Parent 2],[Calculated member 0]}
AddCalculatedMembers({[Parent 1].Children}) | {[Member 1.1], [Member 1.2], [Member 1.3], [Calculated member 1.4]}
AddCalculatedMembers({[Parent 2].[Member 2.1]}) | {[Member 2.1], [Calculated member 2.4]}


Aggregate

Return to: Calculated Member Builder Function List

Returns a calculated value using the appropriate aggregate function, based on the aggregation type of the member.

Syntax

Aggregate(«Set»[, «Numeric Expression»])

Remarks

This function cannot be used on calculated members.

Example

Consider the following expression:

WITH MEMBER Geography.Total AS  'AGGREGATE({USA, France})'

SELECT {Measures.SumSales, Measures.MaxSales} ON COLUMNS,

      {USA, France, Total} ON ROWS

FROM SalesCube

WHERE ([1998])

In this expression, the calculated member Total is displayed first against the measure SumSales and then against the measure MaxSales. In the former case, Total is calculated by adding (with Sum) and in the latter case, Total is calculated by taking the maximum.


Ancestor

Return to: Calculated Member Builder Function List

Returns the ancestor of a member at a specified level.

Syntax

Ancestor(«Member», «Level»)

Example

If the Geography dimension includes levels Country, State, and City, then the following functions return the following values.

Function | Returns
Ancestor(Seattle, Country) | USA
Ancestor(Seattle, State) | Washington


Avg

Return to: Calculated Member Builder Function List

Returns the average value of a numeric expression evaluated over a set.

Syntax

Avg(«Set»[, «Numeric Expression»])

Remarks

This function requires an implicit count of the number of cells, not including empty cells. In order to force the inclusion of empty cells, the application must use the CoalesceEmpty() function. For more information about empty cells, see the OLE DB documentation.

Example
Function | Returns
Avg({USA, CANADA, MEXICO}, Sales) | 2000

The preceding function returns the preceding value if respective Sales are 1000, 2000, and 3000.


BottomCount

Return to: Calculated Member Builder Function List

Returns a specified number of items from the bottom of a set, optionally ordering the set first.

Syntax

BottomCount(«Set», «Count»[, «Numeric Expression»])

Remarks

Sorts a set according to the value of «Numeric Expression» and returns the bottom «Count» members, where «Count» is a numeric expression.

This function always breaks the hierarchy. The TopCount function is similar.

Example

Bottomcount(Geography.Cities.Members, 5, Sales)


BottomPercent

Return to: Calculated Member Builder Function List

Sorts a set and returns the bottom N elements whose cumulative total is at least a specified percentage.

Syntax

BottomPercent(«Set», «Percentage», «Numeric Expression»)

Remarks

Sorts a set using «Numeric Expression» and returns the bottom x elements whose cumulative total of «Numeric Expression» is at least «Percentage». «Percentage» is a numeric expression.

This function always breaks the hierarchy. The TopPercent function is similar.

Example

Bottompercent(Products.[Product Description].Members, 25, Sales)


BottomSum

Return to: Calculated Member Builder Function List

Sorts a set using a numeric expression and returns the bottom N elements whose sum is at least a specified value.

Syntax

BottomSum(«Set», «Value», «Numeric Expression»)

Remarks

Sorts on «Numeric Expression» and picks up the bottom x (the smallest number possible) elements such that their sum is at least «Value».

This function always breaks the hierarchy. The TopSum function is similar.

Example

Bottomsum(Products.[Product Description].Members, 100000, Quantity)


Children

Return to: Calculated Member Builder Function List

Returns the children of a member.

Syntax

«Member».Children

Example

[Geography].[All Geography].[Central Region].Children


ClosingPeriod

Return to: Calculated Member Builder Function List

Returns the last sibling among the descendants of a member at a level.

Syntax

ClosingPeriod([«Level»[, «Member»]])

Remarks

The dimension containing «Level» is used if «Level» is specified; otherwise, the Time dimension is used. If no «Level» is specified, the level below that of «Member» is used. If no «Level» or «Member» is specified, the default is Time.CurrentMember.

This function is equivalent to BottomCount(Descendants(«Member», «Level»), 1).

The function OpeningPeriod is similar, the only difference being that it returns the first sibling instead of the last sibling.

Example

ClosingPeriod(Month, [1991])

returns [1991].December.


CoalesceEmpty

Return to: Calculated Member Builder Function List

Coalesces an empty cell value to a number or a string and returns the coalesced value.

Syntax

CoalesceEmpty(«Value Expression»[, «Value Expression»]...)

Remarks

Returns the first (from the left) non-empty value expression in the list of value expressions. Returns the empty cell value if all value expressions evaluate to the empty cell value.

All value expressions must evaluate to the same type, numeric or string, or to the empty cell value.

For more information about empty cells, see the OLE DB documentation.

Example

To string:

CoalesceEmpty(Time.Parent.Name, "EMPTY")

Returns “EMPTY” if Time.Parent.Name is the empty cell value, Time.Parent.Name otherwise.

To number:

CoalesceEmpty(Measures.CurrentMember, -99)

Returns -99 if Measures.CurrentMember is the empty cell value, Measures.CurrentMember otherwise.


Correlation

Return to: Calculated Member Builder Function List

Returns the correlation of two series evaluated over a set.

Syntax

Correlation(«Set», «Numeric Expression»[, «Numeric Expression»])

Remarks

Evaluates «Set» against the first «Numeric Expression» to get the values for the y-axis. «Set» is evaluated against the second «Numeric Expression», if present, to get the set of values for the x-axis. If the second «Numeric Expression» is not present, the members of «Set» are used as values for the x-axis.

Note Empty cells or cells containing text or logical values are ignored; however, cells with zero values are included.


Count

Return to: Calculated Member Builder Function List

Returns the number of tuples in a set, empty cells included unless the optional EXCLUDEEMPTY flag is used.

Syntax

Count(«Set»[, EXCLUDEEMPTY | INCLUDEEMPTY])

Note Empty cells are counted by default. The comparable Count function in OLE DB excludes empty cells by default.

Remarks

To exclude empty cells, use the optional EXCLUDEEMPTY keyword.

Example

If Time has levels Year and Month, and the members of Year are 1994 and 1995, then:

Count({Time.Month.Members})

returns 24.


Cousin

Return to: Calculated Member Builder Function List

Returns the member with the same relative position under a member as the member specified.

Syntax

Cousin(«Member1», «Member2»)

Remarks

This function operates on the position of members within levels. In the example below it is assumed that both years 1996 and 1994 contain the same number of months preceding the member March. However, if 1996 contained the members January, February, March, and so forth, and 1994 contained the members January, March, April, and so forth, then the example would return [1994].April because it is in the same relative position (third) within the year.

Example

Cousin([1996].March, [1994])

This example yields the member [1994].March.


Covariance

Return to: Calculated Member Builder Function List

Returns the covariance of two series evaluated over a set using the biased population.

Syntax

Covariance(«Set», «Numeric Expression»[, «Numeric Expression»])

Remarks

Evaluates «Set» against the first «Numeric Expression» to get the values for the y-axis. «Set» is evaluated against the second «Numeric Expression», if present, to get the set of values for the x-axis. If the second «Numeric Expression» is not present, the members of «Set» are used as values for the x-axis.

Covariance uses the biased population formula. CovarianceN uses the unbiased population formula.

Note Empty cells or cells containing text or logical values are ignored; however, cells with zero values are included.


CovarianceN

Return to: Calculated Member Builder Function List

Returns the covariance of two series evaluated over a set using the unbiased population formula.

Syntax

Covariance(«Set», «Numeric Expression»[, «Numeric Expression»])

Remarks

Evaluates «Set» against the first «Numeric Expression» to get the values for the y-axis. «Set» is evaluated against the second «Numeric Expression», if present, to get the set of values for the x-axis. If the second «Numeric Expression» is not present, the members of «Set» are used as values for the x-axis.

CovarianceN uses the unbiased population formula. Covariance uses the biased population formula.

Note Empty cells or cells containing text or logical values are ignored; however, cells with zero values are included.


Crossjoin

Return to: Calculated Member Builder Function List

Returns the cross product of two sets.

Syntax

Crossjoin(«Set1», «Set2»)

Remarks

The order of tuples in the resulting set is as follows:

If «Set1» = {x1, x2,...,xn} and «Set2» = {y1, y2, ..., yn}, then Crossjoin(Set1, Set2) is:

{(x1, y1), (x1, y2),...,(x1, yn), (x2, y1), (x2, y2),...,

(x2, yn),..., (xn, y1), (xn, y2),..., (xn, yn)}

Example

Crossjoin({[1994], [1995]}, {USA, Japan})

returns

{([1994], USA), ([1994], Japan), ([1995], USA), ([1995], Japan)}.

Alternate Syntax

«Set1» * «Set2»

Note This alternate syntax is a Microsoft® SQL Server™ OLAP Services multidimensional expression (MDX) extension to OLE DB 2.0 and later.


Current

Return to: Calculated Member Builder Function List

Returns the current tuple from a set during an iteration.

Syntax

«Set».Current

Remarks

During an iteration through a set, as in functions such as Generate, at each step in the iteration the tuple being operated upon is the current tuple. This function returns that tuple.


CurrentMember

Return to: Calculated Member Builder Function List

Returns the current member along a dimension during an iteration.

Syntax

«Dimension».CurrentMember

Remarks

During an iteration through a set of dimension members, at each step in the iteration the member being operated upon is the current member. This function returns that member.


DefaultMember

Return to: Calculated Member Builder Function List

Returns the default member of a dimension.

Syntax

«Dimension».DefaultMember

Remarks

The default member is usually All or one of the top members in the dimension. If there is no All level, DefaultMember is ambiguous.

Example

If the Time dimension has levels (All), Year, Quarter, and Month, and member All-Time, then:

Time.DefaultMember

returns All-Time.


Descendants

Return to: Calculated Member Builder Function List

Returns the set of descendants of a member at a specified level, optionally including or excluding descendants in other levels.

Syntax

Descendants(«Member», «Level»[, «Desc_flag»])

Flags
Flag | Description
SELF | Default. Returns descendant members from «Level» only. Includes «Member», if and only if «Level» specified is the level of «Member».
AFTER | Returns descendant members from all levels subordinate to «Level».
BEFORE | Returns descendant members from all levels between «Member» and «Level», not including members from «Level».
BEFORE_AND_AFTER | Returns descendant members from all levels subordinate to the level of «Member» except members from «Level».
SELF_AND_AFTER | Returns descendant members from «Level» and all levels subordinate to «Level».
SELF_AND_BEFORE | Returns descendant members from «Level» and all levels between «Member» and «Level».
SELF_BEFORE_AFTER | Returns descendant members from all levels subordinate to the level of «Member».

Remarks

By default, only members at the specified level will be included. This function corresponds to a «Desc_flag» value of SELF. By changing the value of «Desc_flag», you can include or exclude descendants at «Level», the children before «Level», and the children after «Level» (until the leaf node).

Example

Assume levels are Countries, States, Counties, and Cities.

Function | Returns
Descendants(USA, Counties) | All counties in USA.
Descendants(USA, Counties, SELF) | All counties in USA.
Descendants(USA, Counties, BEFORE) | All states in USA.
Descendants(USA, Counties, AFTER) | All cities in USA.
Descendants(USA, Counties, BEFORE_AND_AFTER) | All states and cities in USA.
Descendants(USA, Counties, SELF_BEFORE_AFTER) | All states, counties, and cities in USA.


Dimension

Return to: Calculated Member Builder Function List

Returns the dimension that contains a specified member, level, or hierarchy.

 | Members | Levels | Hierarchies
Syntax | «Member».Dimension | «Level».Dimension | «Hierarchy». Dimension
Remarks | Returns the dimension that contains «Member». | Returns the dimension that contains «Level». | Returns «Hierarchy».
Example | [1998].Dimension returns Time. | Year.Dimension returns Time. | FiscalYear. Dimension returns FiscalYear.

Note Microsoft® SQL Server™ OLAP Services implements hierarchies as separate dimensions, so «Hierarchy».Dimension returns «Hierarchy».


Dimensions

Return to: Calculated Member Builder Function List

Returns the dimension specified by a numeric expression or a string.

Numeric String
Syntax Dimensions
(«Numeric Expression») 		Dimensions
(«String Expression»)
Remarks Returns the dimension object
whose zero-based position within the cube is «Numeric Expression». 		Returns the dimension whose
name is specified by «String Expression». Typically used
with user-defined functions.
Example If dimensions Time, Region,
and Product are added to a cube
(in that order), then

Dimensions(2)

returns Region (Measures is
always Dimensions(0)).


Distinct

Return to: Calculated Member Builder Function List

Eliminates duplicate tuples from a set.

Syntax

Distinct(«Set»)

Remarks

Duplicates are eliminated from the tail.

Example

Distinct({(a,b), (c,d), (a,b)})

returns

{(a,b), (c,d )}.


DrilldownLevel

Return to: Calculated Member Builder Function List

Drills down the members of a set to one level below the lowest level represented in the set, or to one level below an optionally specified level of a member represented in the set.

Syntax

DrilldownLevel(«Set»[, «Level»])

Remarks

The members that result from the drill down are hierarchized to occur under their parents. Order is preserved among the original members in «Set».

If «Level» is not specified, it is assumed to be the level of the lowest level member of «Set».

If «Level» is specified and there is no member of «Level» represented in «Set», «Set» is returned.

Alternate Syntax

DrilldownLevel(«Set», , «Index»)

Remarks

When drilling down in sets of tuples, the dimension to be drilled down can be specified by its zero-based numeric position in the tuples instead of by level. For example, in the set:

(Crossjoin(Crossjoin([Store Country].members,[Product Family].members),[Year].members)

a sample tuple is (Canada, Drink, 1998). The Store dimension is position 0, Product dimension is position 1, and Time dimension is position 2. The following expression drills down on the Product dimension:

DrilldownLevel(Crossjoin(Crossjoin([Store Country].members,[Product Family].members),[Year].members),,1)

Note The zero-based «Index» parameter is a Microsoft® SQL Server™ OLAP Services multidimensional expression (MDX) extension to OLE DB.

Example

DrilldownLevel({[Customers Location].USA, [Customers Location].CA, [Customers Location].WA, [Customers Location].Canada})

or, equivalently,

DrilldownLevel({[Customers Location].USA, [Customers Location].CA, [Customers Location].WA, [Customers Location].Canada}, [Customers Location].[State Province])

returns the set

{USA, CA, <all cities in CA>, WA,

<all cities in WA>, Canada}

whereas

DrilldownLevel({[Customers Location].USA, [Customers Location].CA, [Customers Location].WA, [Customers Location].Canada}, [Customers Location].[Country])

returns the set

{USA, CA, WA, Canada, BC}.

For more information, see the OLE DB documentation.


DrilldownLevelBottom

Return to: Calculated Member Builder Function List

Drills down the bottom N members of a set, at a specified level, to one level below.

Syntax

DrilldownLevelBottom(«Set», «Count»[, [«Level»][, «Numeric Expression»]])

Remarks

DrilldownLevelBottom functions like DrilldownLevel but instead of including all children for each member at the specified «Level», only the bottom «Count» number of children are returned, based on «Numeric Expression».

Example

Assuming OR and WA had the lowest sales,

DrilldownLevelBottom({[Customers Location].USA},2,,[Unit Sales])

returns the set

{USA, OR, WA}.

The expression

DrilldownLevelBottom({[Customers Location].[Country].Members},2,,[Unit Sales])

returns the set

{Canada, <bottom two provinces in Canada>, Mexico, <bottom two states in Mexico>, ..., USA, <bottom two states in USA>}.


DrilldownLevelTop

Return to: Calculated Member Builder Function List

Drills down the top N members of a set, at a specified level, to one level below.

Syntax

DrilldownLevelTop(«Set», «Count»[, [«Level»][, «Numeric Expression»]])

Remarks

DrilldownLevelTop functions like DrilldownLevel does, but instead of including all children for each member at the specified «Level», only the top «Count» number of children are returned, based on «Numeric Expression».

Example

Assuming CA and NY had the highest sales,

DrilldownLevelTop({[Customers Location].USA},2,,[Unit Sales])

returns the set

{USA, CA, NY}.

The expression

DrilldownLevelTop({[Customers Location].[Country].Members},2,,[Unit Sales])

returns the set

{Canada, <top two provinces in Canada>, Mexico, < top two states in Mexico>, ..., USA, < top two states in USA>}.


DrilldownMember

Return to: Calculated Member Builder Function List

Drills down the members in a specified set that are present in a second specified set.

Alternatively, drills down on a set of tuples.

Syntax

DrilldownMember({«Set1»}, «Set2»[, RECURSIVE])

Remarks

Drills down the members in «Set1» that are present in «Set2». «Set1» is usually a subset of «Set2». If RECURSIVE is specified, the drilldown continues, comparing the expanded the result set against «Set2» at each step.

«Set1» may contain tuples instead of members. Tuple drilldown is an extension of OLE DB, and it returns a set of tuples instead of members.

Example

DrilldownMember({USA, Canada, Mexico}, {USA, WA, Mexico})

returns the set

{USA, <all states in USA>, Canada, Mexico, <all states in Mexico>}

and

DrilldownMember({USA, Canada, Mexico}, {USA, WA, Mexico},RECURSIVE)

returns the set

{USA, <all states in USA before WA>, WA, <all cities in WA>, <all cities in USA after WA>, Canada, Mexico, <all states in Mexico>}.

Tuple drilldown

DrilldownMember({(USA,[Unit Sales]), (Canada,[Unit Sales]), (Mexico,[Unit Sales])},{USA, WA})

returns the set of tuples

{(USA,[Unit Sales]), (AZ,[Unit Sales]), ... , (WY,[Unit Sales]), (Canada,[Unit Sales]), (Mexico,[Unit Sales])}.

DrilldownMember({(USA,[Unit Sales]), (Canada,[Unit Sales]), (Mexico,[Unit Sales])},{USA, WA},RECURSIVE)

returns the set of tuples

{(USA,[Unit Sales]), (AZ,[Unit Sales]), ... (WA,[Unit Sales]), (<City1 in WA>,[Unit Sales]), ... (<CityN in WA>,[Unit Sales]), ... (WY,[Unit Sales]), (Canada,[Unit Sales]), (Mexico,[Unit Sales])}.


DrilldownMemberBottom

Return to: Calculated Member Builder Function List

Drills down the members in a specified set that are present in a second specified set, limiting the result set to a specified number of members.

Alternatively, drills down on a set of tuples.

Syntax

DrilldownMemberBottom(«Set1», «Set2», «Count»[, «Numeric Expression»][, RECURSIVE]])

Remarks

«Set1» may contain tuples instead of members. Tuple drilldown is an extension of OLE DB, and it returns a set of tuples instead of members.

Functions like DrilldownMember but instead of including all children of a member, only the bottom «Count» number of children are returned, based on «Numeric Expression».

Example

DrilldownMemberBottom({USA, Canada, Mexico}, {USA, WA, Mexico}, 2, [Unit Sales])

returns the set

{USA, <bottom two states in USA>, Canada, Mexico, <bottom two states in Mexico>}

and

DrilldownMemberBottom({USA, WA, Canada, Mexico}, {USA, WA, Mexico}, 2, [Unit Sales], RECURSIVE)

returns the set

{USA, WA, <bottom two cities in WA>, Canada, Mexico, <bottom two states in Mexico>}.

Tuple drilldown

DrilldownMemberBottom({(USA, [Unit Sales]), (WA, [Unit Sales]), (Canada, [Unit Sales]), (Mexico, [Unit Sales])},{USA, WA},2,[Store Sales],RECURSIVE)

returns the set

{(USA, [Unit Sales]), (WA, [Unit Sales]), (<bottom two cities in WA>, [Unit Sales]), (Canada, [Unit Sales]), (Mexico, [Unit Sales]}.


DrilldownMemberTop

Return to: Calculated Member Builder Function List

Drills down the members in a specified set that are present in a second specified set, limiting the result set to a specified number of members.

Alternatively, drills down on a set of tuples.

Syntax

DrilldownMemberTop(«Set1», «Set2», «Count»[, «Numeric Expression»][, RECURSIVE]])

Remarks

«Set1» may contain tuples instead of members. Tuple drilldown is an extension of OLE DB, and it returns a set of tuples instead of members.

Functions like DrilldownMember does, but instead of including all children of a member, only the top «Count» number of children are returned, based on «Numeric Expression».

Example

DrilldownMemberTop({USA, Canada, Mexico}, {USA, WA, Mexico}, 2, [Unit Sales])

returns the set

{USA, <top two states in USA>, Canada, Mexico, <top two states in Mexico>}

and

DrilldownMemberTop({USA, WA, Canada, Mexico}, {USA, WA, Mexico}, 2, [Unit Sales], RECURSIVE)

returns the set

{USA, WA, <top two cities in WA>, Canada, Mexico, <top two states in Mexico>}.

Tuple drilldown

DrilldownMemberTop({(USA, [Unit Sales]), (WA, [Unit Sales]), (Canada, [Unit Sales]), (Mexico, [Unit Sales])},{USA, WA},2,[Store Sales],RECURSIVE)

returns the set

{(USA, [Unit Sales]), (WA, [Unit Sales]), (<top two cities in WA>, [Unit Sales]), (Canada, [Unit Sales]), (Mexico, [Unit Sales]}.


DrillupLevel

Return to: Calculated Member Builder Function List

Drills up the members of a set that are below a specified level.

Syntax

DrillupLevel(«Set»[, «Level»])

Remarks

If «Level» is not specified, it is assumed to be one less than the level of the lowest level member in «Set».

Example

DrillUpLevel({USA, CA, [Los Angeles], WA, Seattle, Canada, BC})

returns the set

{USA, CA, WA, Canada, BC}

and

DrillUpLevel({USA, CA, [Los Angeles], WA, Seattle, Canada, BC},[Store Country])

returns the set

{USA, Canada }.


DrillupMember

Return to: Calculated Member Builder Function List

Drills up the members in a specified set that are present in a second specified set.

Syntax

DrillupMember(«Set1», «Set2»)

Remarks

Drills up the members in «Set1» that are present in «Set2». «Set2» is usually a subset of «Set1».

Example

DrillupMember({Canada, Mexico, USA, WA, Seattle},{WA})

returns the set

{Canada, Mexico, USA, WA}.


Except

Return to: Calculated Member Builder Function List

Finds the difference between two sets, optionally retaining duplicates.

Syntax

Except(«Set1», «Set2»[, ALL])

Remarks

Duplicates are eliminated from both sets prior to finding the difference. The optional ALL flag retains duplicates. Matching duplicates in «Set1» are eliminated and non-matching duplicates are retained.

Example

Except({Canada, BC, BC, Mexico, USA, WA}, {Canada, Mexico, CA})

returns

{BC, USA, WA}

and

Except({Canada, BC, BC, Mexico, USA, WA}, {Canada, Mexico, CA},ALL)

returns

{BC, BC, USA, WA}.


Extract

Return to: Calculated Member Builder Function List

Returns a set of tuples from extracted dimension elements. The opposite of Crossjoin.

Syntax

Extract(«Set», «Dimension»[, «Dimension»...])

Remarks

Returns a set consisting of tuples from the extracted «Dimension» elements. This function always removes the duplicates. This function is the opposite of the Crossjoin function.

Example

Extract({([1997], WA), ([1997], CA), ([1998], CA)}, Time)

returns the set

{[1997], [1998]}


Filter

Return to: Calculated Member Builder Function List

Returns the set resulting from filtering a set based on a search condition.

Syntax

Filter(«Set», «Search Condition»)

Example

Filter(SampleSet, (Sales,[1996]) < (Sales, [1995]))

returns

{Paris, Buffalo}

if these cities declined in sales.


FirstChild

Return to: Calculated Member Builder Function List

Returns the first child of a member.

Syntax

«Member».FirstChild

Example

If the Time dimension includes the levels Year, Quarter, Month, Week, and Day, then:

[1995].Firstchild

returns January.


FirstSibling

Return to: Calculated Member Builder Function List

Returns the first child of the parent of a member.

Syntax

«Member».FirstSibling

Example

May.FirstSibling

returns April (assuming that the parent level is quarters).


Generate

Return to: Calculated Member Builder Function List

Applies a set to each member of another set and joins the resulting sets by union.

Syntax

Generate(«Set1», «Set2»[, ALL])

Remarks

Applies «Set2» to each member of «Set1» and joins the resulting sets by union.

If ALL is specified, duplicates in the result are retained.

Example

Generate({USA, France}, Descendants(Geography.CurrentMember, Cities))

For each member of the set {USA, France}, this function applies the expression Descendants(Geography.CurrentMember, Cities). Each such application results in a set. (Application to USA will generate the set of all cities in USA; application to France will generate all cities in France.) These sets are joined by union to get the result of this function. In this example, all cities in USA and France will be the result. In general, Generate(«Set1», «set_expression») will apply «set_expression» to each member of «Set1» and join the results by union.

If «Set1» is not related to «set_expression» by means of CurrentMember, then Generate results in a simple replication of the set implied by «set_expression», with as many replications as there are tuples in «Set1». If the optional ALL flag is specified, all duplicates are retained in the result. If ALL is not specified, duplicates are removed. For example,

Generate({USA, FRANCE}, {SEATTLE, BOSTON}, ALL)

returns the set

{SEATTLE, BOSTON, SEATTLE, BOSTON}.

However, if ALL was not specified, then the set returned is

{SEATTLE, BOSTON}.


Head

Return to: Calculated Member Builder Function List

Returns the first specified number of elements in a set.

Syntax

Head(«Set»[, «Numeric Expression»])

Remarks

Returns the first «Numeric Expression» elements in a set. The order of elements is preserved. The default value of «Numeric Expression» is 1. If «Numeric Expression» is less than 1, the empty set is returned. If «Numeric Expression» exceeds the number of tuples in the set, the original set is returned.

Example

Head({USA, Canada, France, Germany, Japan}, 3)

returns the set

{USA, Canada, France}.


Hierarchize

Return to: Calculated Member Builder Function List

Orders the members of a set in a hierarchy.

Syntax

Hierarchize(«Set»)

Remarks

Orders the members of «Set» in a hierarchy. Members in a level are sorted in their natural order, the default ordering of the members along a dimension when no other sort conditions are specified. Hierarchize will always retain duplicates.

Example

Hierarchize(SampleSet)

returns the set in natural order. The hierarchized dataset follows (assuming that the natural order for the data source is alphabetical):

France |  |
 |  | Nice
 |  | Paris
UK |  |
 |  | London
USA |  |
 | California |
 |  | LA
 |  | Buffalo
 |  | NYC


Hierarchy

Return to: Calculated Member Builder Function List

Returns the hierarchy that contains a specified member or level.

 | Members | Levels
Syntax | «Member».Hierarchy | «Level».Hierarchy
Remarks | Returns the hierarchy that contains «Member». | Returns the hierarchy that contains «Level».
Example | [January].Hierarchy returns Time.FiscalYear | [Year].Hierarchy returns Time.FiscalYear


IIf

Return to: Calculated Member Builder Function List

Returns one of two values determined by a logical test.

Syntax

IIf(«Logical Expression», «Value Expression1», «Value Expression2»)

Remarks

Returns «Value Expression1» if «Logical Expression» evaluates to TRUE, otherwise returns «Value Expression2».

«Value Expression1» and «Value Expression2» must evaluate to the same type, either numeric or string.

Example

To string:

IIf(IsEmpty(Measures.CurrentMember), "Yes", "No")

Returns "Yes" if Measures.CurrentMember is an empty cell, "No" otherwise.

To number:

IIf(IsEmpty(Measures.CurrentMember), 0, 1)

Returns 0 if Measures.CurrentMember is an empty cell, 1 otherwise.


Intersect

Return to: Calculated Member Builder Function List

Returns the intersection of two input sets, optionally retaining duplicates.

Syntax

Intersect(«Set1», «Set2»[, ALL])

Remarks

Returns the intersection of «Set1» and «Set2». By default, duplicates are eliminated from both sets prior to intersection.

The optional ALL retains duplicates. There are several ways for ALL to work. The algorithm is: Nonduplicated elements are intersected as usual. For each duplicate in «Set1», match it with a duplicate in «Set2», if one exists, and keep matching duplicates in the intersected set.

Example

Intersect({[1994], [1995], [1996]}, {[1995], [1996], [1997]})

returns the set

{[1995], [1996]}.


IsEmpty

Return to: Calculated Member Builder Function List

Returns TRUE if and only if the evaluated expression is the empty cell value. Returns FALSE otherwise.

Syntax

IsEmpty(«Value Expression»)

Remarks

For more information about empty cells, see the OLE DB documentation.

Example

IsEmpty(Measures.CurrentMember)

returns TRUE if Measures.CurrentMember is an empty cell.


Item

Return to: Calculated Member Builder Function List

Returns a member from a tuple or a tuple from a set.

 | Members | Tuples
Syntax | «Tuple».Item(«Numeric Expression») | «Set».Item(«String Expression»[, «String Expression»...] | «Index»)
Remarks | Returns the member whose zero-based position in the tuple is specified by «Numeric Expression». | Returns a tuple from «Set». The «String Expression»[, «String Expression»...] specifies which tuple to retrieve. The «Index» value specifies the position of the tuple in «Set». The numbering of the tuples is zero-based.
Example | Time.Year.Members.Item(0) returns [1996] | {([1994],Sales), ([1995],Sales), ([1996],Sales)}.Item(0) returns ([1994],Sales).


Lag

Return to: Calculated Member Builder Function List

Returns the member that is a specified number of positions prior to a specified member along the member's dimension.

Syntax

«Member».Lag(«Numeric Expression»)

Remarks

Member positions in the dimension are determined by the dimension’s natural order. The numbering of the positions is zero-based.

If «Numeric Expression» is zero, «Member» is returned. If «Numeric Expression» is negative, a subsequent member is returned.

Lag(1) is equivalent to PrevMember. Lag(-1) is equivalent to NextMember.

The function «Member».Lead is similar, except that it looks in the opposite direction. Lag(n) is equivalent to Lead(-n).

Example

If the levels in the Time dimension include Year and Month, then:

[1995].February.Lag(3)

returns [1994].November.


LastChild

Return to: Calculated Member Builder Function List

Returns the last child of a member.

Syntax

«Member».LastChild

Example

If a Time dimension includes Year, Quarter, Month, Week, and Day, then:

1995.Lastchild

returns December.


LastPeriods

Return to: Calculated Member Builder Function List

Returns a set of members prior to and including a specified member.

Syntax

LastPeriods(«Index»[, «Member»])

Remarks

If «Member» is not specified, then it is Time.CurrentMember.

If «Index» is positive, returns the set of «Index» members ending with «Member» and starting with the member lagging «Index» - 1 from «Member».

If «Index» is negative, returns the set of (- «Index») members starting with «Member» and ending with the member leading (- «Index» - 1) from «Member».

If «Index» is zero, the empty set is returned.

Examples
Expression | Returns
LastPeriods(2, [1997June]) | {[1997May], [1997June]}
LastPeriods(-2, [1997June]) | {[1997June], [1997July]}
LastPeriods(1, [1997June]) | {[1997June]}
LastPeriods(-1, [1997June]) | {[1997June]}
LastPeriods(0, [1997June]) | Empty set


LastSibling

Return to: Calculated Member Builder Function List

Returns the last child of the parent of a member.

Syntax

«Member».LastSibling

Example

May.LastSibling

returns June (assuming that the parent level is quarters).


Lead

Return to: Calculated Member Builder Function List

Returns the member that is a specified number of positions following a specified member along the member's dimension.

Syntax

«Member».Lead(«Numeric Expression»)

Remarks

Member positions in the dimension are determined by the dimension’s natural order. The numbering of the positions is zero-based.

If «Numeric Expression» is zero, «Member» is returned. If «Numeric Expression» is negative, a prior member is returned.

Lead(1) is equivalent to NextMember. Lead(-1) is equivalent to PrevMember.

The function «Member».Lag is similar, except that it looks in the opposite direction. Lead(n) is equivalent to Lag(-n).

Example

If the levels in the Time dimension include Year and Month, then:

[1994].November.Lead(3)

returns [1995].February.


Level

Return to: Calculated Member Builder Function List

Returns a member's level.

Syntax

«Member».Level

Example

If the Time dimension has levels All, Year, Quarter, Month, Week, and Day, then:

January.Level

returns the Month level.

January.Level.Name

returns the name of the Month level.


Levels

Return to: Calculated Member Builder Function List

Returns the level whose name is specified by a string expression, or the level whose position in a dimension is specified by a zero-based numeric expression.

String Expressions | Dimension Indexes
Syntax | Levels(«String Expression») | «Dimension».Levels(«Numeric Expression»)
Remarks | Returns the level whose name is specified by «String Expression». Typically used with user-defined functions. | Returns the «Dimension» level specified by «Numeric Expression».
Example Levels(“Year”)
returns the Year level. 		If the Time dimension has levels All, Year, Quarter, Month, Week, and Day, then:

Time.Levels(2)

returns the Quarter level.


LinRegIntercept

Return to: Calculated Member Builder Function List

Calculates the linear regression of a set and returns the value of b in the regression line y = ax + b.

Syntax

LinRegIntercept(«Set», «Numeric Expression»
[, «Numeric Expression»])

Remarks

Linear regression by using the least-squares method calculates the equation of the best-fit line for a series of points. Let the regression line be given by the equation

y = ax+b

where a is called the intercept and b is called the slope.

This function evaluates «Set» against the first «Numeric Expression» to get the set of values for the y-axis. It then evaluates «Set» against the second «Numeric Expression», if present, to get the set of values for the x-axis. If the second «Numeric Expression» is not present, the function uses the members of «Set» as values for the x-axis.

The latter case is not often useful for standard dimensions (for example, SalesPerson). However, it is often used with the time dimension.

After obtaining the set of points, LinRegIntercept returns the intercept of the regression line (b in the equation above).

Note Empty cells or cells containing text or logical values are ignored; however, cells with zero values are included.

Example

To find the trend in Sales for the sales of the last nine periods:

LinRegSlope(LastPeriods(9), Sales) returns the value for a.

LinRegIntercept(LastPeriods(9), Sales) returns the value for b.


LinRegPoint

Return to: Calculated Member Builder Function List

Calculates the linear regression of a set and returns the value of y in the regression line y = ax + b.

Syntax

LinRegPoint(«Numeric Expression», «Set», «Numeric Expression»[, «Numeric Expression»])

Remarks

Linear regression by using the least-squares method calculates the equation of the best-it line for a series of points. Let the regression line be given by the equation

y = ax+b

where a is called the intercept and b is called the slope.

LinRegPoint uses the last three arguments, that is «Set» and «Numeric Expression», like the other LinReg xxx functions to calculate the regression line. The function evaluates the first argument «Numeric Expression» and uses the resulting number as the “x” value in the regression equation (y = ax + b) to calculate the “y” value.

Note Empty cells or cells containing text or logical values are ignored; however, cells with zero values are included.

Example

To find the trend in Sales for the sales of the last nine periods and forecast the next period:

LinRegSlope(LastPeriods(9), Sales) returns the value for a.

LinRegIntercept(LastPeriods(9), Sales) returns the value for b.

LinRegPoint(10, LastPeriods(9), Sales) returns the next period.


LinRegR2

Return to: Calculated Member Builder Function List

Calculates the linear regression of a set and returns R2 (the coefficient of determination).

Syntax

LinRegR2(«Set», «Numeric Expression»[, «Numeric Expression»])

Remarks

Linear regression by using the least-squares method calculates the equation of the best-fit line for a series of points. Let the regression line be given by the equation

y = ax+b

where a is called the intercept and b is called the slope.

This function evaluates «Set» against the first «Numeric Expression» to get the set of values for the y-axis. It then evaluates «Set» against the second «Numeric Expression», if present, to get the set of values for the x-axis. If the second «Numeric Expression» is not present, the function uses the members of «Set» as values for the x-axis.

The latter case is not often useful for standard dimensions (for example, SalesPerson). However, it is often used with the time dimension.

After obtaining the set of points, LinRegR2 returns the statistical R2 that describes the fit of the linear equation to the points.

Note Empty cells or cells containing text or logical values are ignored; however, cells with zero values are included.


LinRegSlope

Return to: Calculated Member Builder Function List

Calculates the linear regression of a set and returns the value of a in the regression line y = ax + b.

Syntax

LinRegSlope(«Set», «Numeric Expression»[, «Numeric Expression»])

Remarks

Linear regression by using the least-squares method calculates the equation of the best-fit line for a series of points. Let the regression line be given by the equation

y = ax+b

where a is called the intercept and b is called the slope.

This function evaluates «Set» against the first «Numeric Expression» to get the set of values for the y-axis. It then evaluates «Set» against the second «Numeric Expression», if present, to get the set of values for the x-axis. If the second «Numeric Expression» is not present, the function uses the members of «Set» as values for the x-axis.

The latter case is not often useful for standard dimensions (for example, SalesPerson). However, it is often used with the time dimension.

After obtaining the set of points, LinRegSlope returns the slope of the regression line (a in the equation above).

Note Empty cells or cells containing text or logical values are ignored; however, cells with zero values are included.

Example

To find the trend in Sales for the sales of the last nine periods:

LinRegSlope(LastPeriods(9), Sales) returns the value for a.

LinRegIntercept(LastPeriods(9), Sales) returns the value for b.


LinRegVariance

Return to: Calculated Member Builder Function List

Calculates the linear regression of a set and returns the variance associated with the regression line y = ax + b.

Syntax

LinRegVariance(«Set», «Numeric Expression»[, «Numeric Expression»])

Remarks

Linear regression by using the least-squares method calculates the equation of the best-fit line for a series of points. Let the regression line be given by the equation

y = ax+b

where a is called the intercept and b is called the slope.

This function evaluates «Set» against the first «Numeric Expression» to get the set of values for the y-axis. It then evaluates «Set» against the second «Numeric Expression», if present, to get the set of values for the x-axis. If the second «Numeric Expression» is not present, the function uses the members of «Set» as values for the x-axis.

The latter case is not often useful for standard dimensions (for example, SalesPerson). However, it is often used with the time dimension.

After obtaining the set of points, LinRegVariance returns the statistical variance that describes the fit of the linear equation to the points.

Note Empty cells or cells containing text or logical values are ignored; however, cells with zero values are included.


Max

Return to: Calculated Member Builder Function List

Returns the maximum value of a numeric expression evaluated over a set.

Syntax

Max(«Set»[, «Numeric Expression»])

Example

Max({USA, CANADA, MEXICO}, Sales)

returns 3000 if respective Sales of the countries are 1000, 2000, and 3000.


Median

Return to: Calculated Member Builder Function List

Returns the median value of a numeric expression evaluated over a set.

Syntax

Median(«Set»[, «Numeric Expression»])

Example

Median({USA, CANADA, MEXICO}, Sales)

returns 2000 if respective Sales of the countries are 1000, 2000, and 3000.


Members

Return to: Calculated Member Builder Function List

Returns the set of members in a dimension, level, or hierarchy, or the member whose name is specified by a string.

Syntax 1

«Dimension».Members

Remarks 1

Returns the set of all members in «Dimension».

Example 1

Geography.Members

returns the set of all members in the Geography dimension.

Syntax 2

«Hierarchy».Members

Remarks 2

Returns the set of all members in «Hierarchy».

Example 2

Time.Quarterly.Members

returns the set of all members in the Quarters hierarchy of the Time dimension.

Syntax 3

«Level».Members

Remarks 3

Returns the set of all members at a specified level in a dimension.

Example 3

If the Year level contains [1994], [1995], and [1996], then:

Year.Members

returns the set

{[1994], [1995], [1996]}.

Syntax 4

Members(«String Expression»)

Remarks 4

Returns the member whose name is given by «String Expression». Typically used with user-defined functions.

Example 4

Members(UDF())

where UDF() is a user-defined function that returns a string.


Min

Return to: Calculated Member Builder Function List

Returns the minimum value of a numeric expression evaluated over a set.

Syntax

Min(«Set»[, «Numeric Expression»])

Example

Min({USA, CANADA, MEXICO}, Sales)

returns 1000 if the respective Sales of the countries are 1000, 2000, and 3000.


Mtd

Return to: Calculated Member Builder Function List

A shortcut function for the PeriodsToDate function that specifies the level to be Month.

Syntax

Mtd([«Member»])

Remarks

A shortcut function to the PeriodsToDate function that defines that function's «Level» argument to be Month. If no member is specified, then the default is Time.CurrentMember.

Mtd(«Member») is the equivalent of PeriodsToDate(Month, «Member»).

Example

MTD()


Name

Return to: Calculated Member Builder Function List

Returns the name of a level, dimension, member, or hierarchy.

 | Levels | Dimensions | Members | Hierarchies
Syntax | «Level».Name | «Dimension».Name | «Member».Name | «Hierarchy». Name
Remarks | Returns the name of a level. | Returns the name of a dimension. | Returns the name of a member. | Returns the name of a hierarchy.
Example | Products. [Product Description]. Name | Products.Name | Products.[Product Description]. Widget.Name | Time.[Fiscal Year].Name


NextMember

Return to: Calculated Member Builder Function List

Returns the next member in the level that contains a specified member.

Syntax

«Member».NextMember

Example

If the Year level consists of 1994, 1995, and 1996, then:

[1994].NextMember

returns [1995].


OpeningPeriod

Return to: Calculated Member Builder Function List

Returns the first sibling among the descendants of a member at a level.

Syntax

OpeningPeriod([«Level»[, «Member»]])

Remarks

The dimension containing «Level» is used if «Level» is specified; otherwise, the Time dimension is used. If no «Level» is specified, the level below that of «Member» is used. If no «Level» or «Member» is specified, the default is Time.CurrentMember.

This function is equivalent to TopCount(Descendants(«Member», «Level»), 1).

The function ClosingPeriod is similar, the only difference being that it returns the last sibling instead of the first sibling.

Example

OpeningPeriod(Month, [1991])

returns [1991].January.


Order

Return to: Calculated Member Builder Function List

Arranges members of a set, optionally preserving or breaking the hierarchy.

Syntax

Order(«Set», {«String Expression» | «Numeric Expression»}
[, ASC | DESC | BASC | BDESC])

Remarks

There are two varieties of Order: hierarchized (ASC or DESC) and nonhierarchized (BASC or BDESC where “B” indicates “Break hierarchy”). The hierarchized ordering first arranges members according to their position in the hierarchy. Then it orders each level. The nonhierarchized ordering arranges members in the set without regard to the hierarchy. In the absence of an explicit specification, ASC is the default.

Example

Order(SampleSet, ([1995], Sales), DESC)

hierarchizes all members and sorts each level according to Sales. Sales are compared at the highest level when the sorted list is constructed. Therefore, if the sum of Sales in all California cities is less than the sum of Sales in all New York cities, California and California.LA will appear below NYC in the sorted, descending list.

The result of

Order(SampleSet, ([1995], Sales), DESC)

is as follows:

Location |  |  | 1995 sales
USA |  |  | 5000
 | California |  | 2000
 |  | LA | 500
 |  | Buffalo | 300
 |  | NYC | 900
France |  |  | 2500
 |  | Paris | 365
 |  | Nice | 27
UK |  |  | 1900
 |  | London | 250

Order(SampleSet, ([1995], Sales), BDESC)

sorts the members according to their values without regard for their relative positions in the member hierarchy. In this example, numeric values are sorted by 1995 sales per city, including aggregate sales values by state and country.

The result of

Order(SampleSet, ([1995], Sales), BDESC)

is as follows:

Location | 1995 sales
USA | 5000
France | 2500
California | 2000
UK | 1900
NYC | 900
LA | 500
Paris | 365
Buffalo | 300
London | 250
Nice | 27

Note When the input set has two elements for which the «String Expression» or «Numeric Expression» has the same value, the input order is preserved.

For example if the sales for USA & Europe is 300 each, and that for Asia is 100, then the call:

Order({USA, Europe, Asia}, Sales, BASC)

returns the set

{Asia, USA, Europe}

and not the set

{Asia, Europe, USA}.


Ordinal

Return to: Calculated Member Builder Function List

Returns the zero-based ordinal value associated with a level.

Syntax

«Level».Ordinal

Example

Products.[Product Description].Ordinal


ParallelPeriod

Return to: Calculated Member Builder Function List

Returns a member from a prior period in the same relative position as a specified member, for example the same relative month in the previous quarter.

Syntax

ParallelPeriod([«Level»[, «Numeric Expression»[, «Member»]]])

Remarks

This function is similar to the Cousin function, but is more closely related to Time series. It takes the ancestor of «Member» at «Level» (call it ancestor); then it takes the sibling of ancestor that lags by «Numeric Expression», and returns the parallel period of «Member» among the descendants of that sibling.

This function has the following defaults:

Default «Member» value is Time.CurrentMember if «Level» is not specified. Otherwise it is dimension.CurrentMember, where dimension is the dimension to which level belongs.

Default «Numeric Expression» is 1.

Default «Level» is the level of the parent of «Member».

This function is equivalent to:

Cousin(Member,Lag(Ancestor(Member,Level),Numeric Expression)

Example
Expression | Returns
PARALLELPERIOD(Year,2, [96 Qtr 3]) | [94 Qtr 3]
PARALLELPERIOD(Year,2) | The parallel period of Time.CurrentMember, two years ago. That is, if Time.CurrentMember is [1993June], then the returned member is [1991June].
PARALLELPERIOD(Year) | The parallel period of Time.CurrentMember from last year. That is, if Time.CurrentMember is [1993June], then the returned member is [1992June].
PARALLELPERIOD() | The parallel period in the immediately prior sibling to the parent of Time.CurrentMember. For example, if Time.CurrentMember is [1993June], then the returned member is [1993March]. The parent of ([1993June] is Quarter2, whose immediately prior sibling is Quarter1, in which the parallel period is [1993March].


Parent

Return to: Calculated Member Builder Function List

Returns the parent of a member.

Syntax

«Member».Parent

Example

If the Geography dimension includes State and Country, then:

California.Parent

returns USA.


PeriodsToDate

Return to: Calculated Member Builder Function List

Returns a set of periods (members) from a specified level starting with the first period and ending with a specified member.

Syntax

PeriodsToDate([«Level»[, «Member»]])

Remarks

Within the scope of «Level», returns the set of periods on the level of «Member», starting with the first period and ending with «Member». If no level or member is specified, then the «Member» value is Time.CurrentMember and «Level» is the parent level of Time.CurrentMember. If a level is specified, then «Member» is dimension.CurrentMember, where dimension is the dimension of «Level».

Example
Expression | Returns
PeriodsToDate(Quarter, [05-Sep-1997]) | The set of days from the beginning of Quarter3.
PeriodsToDate(Year, March) | The set {January, February, March}.
PeriodsToDate(Year) | The set of members from the beginning of the year that is the ancestor of Time.CurrentMember, through Time.CurrentMember.
PeriodsToDate() | The set of members from the beginning of the containing period of Time.CurrentMember to Time.CurrentMember. All the returned members are at the same level as Time.CurrentMember.

PeriodsToDate(level, member) is the same as:

TopCount(Descendants(Ancestor(member, level), member.Level), 1):member


PrevMember

Return to: Calculated Member Builder Function List

Returns the previous member in the level that contains a specified member.

Syntax

«Member».PrevMember

Example

If the Year level consists of [1994], [1995], and [1996], then:

[1996].Prevmember

returns [1995].


Qtd

Return to: Calculated Member Builder Function List

A shortcut function for the PeriodsToDate function that specifies the level to be Quarter.

Syntax

Qtd([«Member»])

Remarks

A shortcut function to the PeriodsToDate function that predefines that function's «Level» argument to be Quarter. If no member is specified, then the default is Time.CurrentMember.

Qtd(«Member») is the equivalent of PeriodsToDate(Quarter, «Member»).

Example

Qtd()


Rank

Return to: Calculated Member Builder Function List

Returns the one-based rank of a tuple in a set.

Syntax

Rank(«Tuple», «Set»)

Example

Rank((c,d), {(a,b), (c,d), (e,f)})

returns 2.


SetToArray

Return to: Calculated Member Builder Function List

Converts one or more sets to an array for use in a user-defined function.

Syntax

SetToArray(«Set»[, «Set»]...[, «Numeric Expression»])

Remarks

Converts one or more sets to an array for use in a user-defined function. The number of dimensions in the resulting array is the same as the number of sets specified.

The optional numeric expression can be used to provide the values in the array cells. If omitted, the default value of the set member is used for the array cell value.

The cell coordinates in the resulting array correspond to the position of the sets in the list. For example, SetToArray(SA, SB, SC), where each set has two elements, produces the three-dimensional array:

(SA1, SB1, SC1) (SA2, SB1, SC1) (SA1, SB2, SC1) (SA2, SB2, SC1)

(SA1, SB1, SC2) (SA2, SB1, SC2) (SA1, SB2, SC2) (SA2, SB2, SC2)

Example

SetToArray(Geography.Members, Measures.Sale)


SetToStr

Return to: Calculated Member Builder Function List

Constructs a string from a set.

Syntax

SetToStr(«Set»)

Example

SetToStr({1995, 1996})

returns

"{[Time].[1995], [Time].[1996]}".


Stddev

Return to: Calculated Member Builder Function List

Alias for Stdev.


StddevP

Return to: Calculated Member Builder Function List

Alias for StdevP.


Stdev

Return to: Calculated Member Builder Function List

Returns the standard deviation of a numeric expression evaluated over a set (unbiased).

Syntax

Stdev(«Set»[, «Numeric Expression»])

Note Stdev uses the unbiased population formula. StdevP uses the biased population formula.

Example

Stdev({USA, CANADA, MEXICO}, Sales)


StdevP

Return to: Calculated Member Builder Function List

Returns the standard deviation of a numeric expression evaluated over a set (biased).

Syntax

StdevP(«Set»[, «Numeric Expression»])

Note StdevP uses the biased population formula. Stdev uses the unbiased population formula.

Example

Stdev({USA, CANADA, MEXICO}, Sales)


StripCalculatedMembers

Return to: Calculated Member Builder Function List

Removes calculated members from a set.

Syntax

StripCalculatedMembers(«Set»)

Remarks

Removes calculated members from a set that includes calculated members added with AddCalculatedMembers.


StrToSet

Return to: Calculated Member Builder Function List

Constructs a set from a string expression.

Syntax

StrToSet(«String Expression»)

Example

StrToSet("Time.Members")

returns a set containing all the members of the Time dimension.


StrToTuple

Return to: Calculated Member Builder Function List

Constructs a tuple from a string expression.

Syntax

StrToTuple(«String Expression»)

Example

StrToTuple("(Sales, [1994])")

returns (Sales, [1994]).


Subset

Return to: Calculated Member Builder Function List

Returns a subset of elements from a set.

Syntax

Subset(«Set», «Start»[, «Count»])

Remarks

Returns «Count» elements from «Set», starting at position «Start». «Start» is zero-based: 0 corresponds to the first element in the set, 1 corresponds to the second, and so on. If «Count» is not specified, all elements from «Start» to the end of the set are returned.

Example

Subset({USA, Canada, France, Germany, Japan, England, Peru}, 0, 2)

returns the set

{USA, Canada}.


Sum

Return to: Calculated Member Builder Function List

Returns the sum of a numeric expression evaluated over a set.

Syntax

Sum(«Set»[, «Numeric Expression»])

Example

Sum({USA, CANADA, MEXICO}, Sales.VALUE)

returns 6000 if their respective Sales are 1000, 2000, and 3000. This can also be written in a more intuitive way as

Sum({USA, CANADA, MEXICO}, Sales).


Tail

Return to: Calculated Member Builder Function List

Returns a subset from the end of a set.

Syntax

Tail(«Set»[, «Count»])

Remarks

Returns the last «Count» elements in a set. The order of elements is preserved. The default value of «Count» is 1. If «Count» is less than 1, the empty set is returned. If «Count» exceeds the number of tuples in the set, the original set is returned.

Example

Tail({USA, Canada, France, Germany, Japan}, 3)

returns the set

{France, Germany, Japan}.


ToggleDrillState

Return to: Calculated Member Builder Function List

Toggles the drill state of members. This function is a combination of DrillupMember and DrilldownMember.

Syntax

ToggleDrillState(«Set1», «Set2»[, RECURSIVE])

Remarks

Toggles the drill state of each member of «Set2» that is present in «Set1». If a member m of «Set2» that is present in «Set1» is drilled down (that is, has a descendant), DrillupMember(«Set1», {m}) is applied. If it is drilled up (that is, there is no descendant of m that immediately follows m), DrilldownMember(«Set1», {m}[, RECURSIVE]) is applied to Set1. The optional RECURSIVE flag is used if ToggleDrillState was called with RECURSIVE.


TopCount

Return to: Calculated Member Builder Function List

Returns a specified number of items from the top of a set, optionally ordering the set first.

Syntax

TopCount(«Set», «Count»[, «Numeric Expression»])

Remarks

Sorts a set according to the value of «Numeric Expression» and returns the top «Count» members, where «Count» is a numeric expression.

This function always breaks the hierarchy. The BottomCount function is similar.

Example

Topcount(Geography.Cities.Members, 5, Sales)


TopPercent

Return to: Calculated Member Builder Function List

Sorts a set and returns the top N elements whose cumulative total is at least a specified percentage.

Syntax

TopPercent(«Set», «Percentage», «Numeric Expression»)

Remarks

Sorts a set using «Numeric Expression» and returns the top N elements whose cumulative total of «Numeric Expression» is at least «Percentage». «Percentage» is a numeric expression.

This function always breaks the hierarchy. The BottomPercent function is similar.

Example

TopPercent({London, Paris, Rome, New York, Seattle, Tokyo}, 15, Sales)


TopSum

Return to: Calculated Member Builder Function List

Sorts a set and returns the top N elements whose cumulative total is at least a specified value.

Syntax

TopSum(«Set», «Value», «Numeric Expression»)

Remarks

Sorts on «Numeric Expression» and picks up the top N (the smallest number possible) elements such that their sum is at least «Value».

This function always breaks the hierarchy. The BottomSum function is similar.

Example

Topsum(Products.[Product Description].Members, 100000, Quantity)


TupleToStr

Return to: Calculated Member Builder Function List

Constructs a string from a tuple.

Syntax

TupleToStr(«Tuple»)

Example

TupleToStr(France, 1995)

returns

"([Time].[1995], [Regions].[All Regions].[Europe].[France])".


Union

Return to: Calculated Member Builder Function List

Returns the union of two sets, optionally retaining duplicates.

Syntax

Union(«Set1», «Set2»[, ALL])

Remarks

Returns the union of «Set1» and «Set2», eliminating duplicates by default. The ALL flag keeps duplicates in the joined set. Duplicates are deleted from the tail.

Alternate Syntax
(Implicit Union)

{Set1, Set2} or «Set1» + «Set2»

Other ways of joining by union is to use a comma-separated list of sets within braces or to use the + operator. For example,

1. {USA.Children, CANADA.Children}

2. {USA.Children} + {CANADA.Children}

are equivalent to

Union(USA.Children, CANADA.Children, ALL).

Duplicated members are always retained when an alternate syntax is used.

Note This alternate syntax is a Microsoft® SQL Server™ OLAP Services multidimensional expression (MDX) extension to OLE DB.


UniqueName

Return to: Calculated Member Builder Function List

Returns the unique name of a level, dimension, or member.

 | Levels | Dimensions | Members
Syntax | «Level».UniqueName | «Dimension». UniqueName | «Member». UniqueName
Remarks | Returns the unique name of a level. | Returns the unique name of a dimension. | Returns the unique name of a member.
Example | Products.[Product Description]. Uniquename | Products.Uniquename | Products.[Product Description].Widget. Uniquename


ValidMeasure

Return to: Calculated Member Builder Function List

Returns a valid measure in a virtual cube by forcing inapplicable dimensions to their top level.

Syntax

ValidMeasure(«Tuple»)

Remarks

When computing values in a virtual cube, measure cells only contain values at the (All) level for dimensions that are not common between the underlying cubes. The ValidMeasure function returns the measure value from the cell at the (All) level coordinates for the dimensions that are not common.

Example

Consider a virtual cube named ExchSales derived from cubes Sales and ExchRate. The Sales cube contains dimensions Time, Products, and Customers, and the measure Sale in dollars. The ExchRate cube contains dimensions Time and Currency, and the measure Rate.

To create a calculated member YenSale that returns the value of each sale in Yen, the (All) level must be specified for each dimension not present in the ExchRate cube for there to be a value present in the virtual cube cell. This can be cumbersome for virtual cubes where a number of dimensions are not common between the underlying cubes.

The ValidMeasure function ensures the measure's value is taken from the appropriate cell at the (All) level for each dimension not in common. The following two MDX expressions are equivalent:

YenSale = Sum({Descendants(Time.CurrentMember, Day}},
   Sale * (Currency.Yen, AllProducts, AllCustomers))

YenSale = Sum({Descendants(Time.CurrentMember, Day}},
   Sale * ValidMeasure(Currency.Yen))


Value

Return to: Calculated Member Builder Function List

Returns the value of a measure. Value is the default property of a measure.

Syntax

«Member».Value

Example

Sales.Measures.CurrentMember.Value


Var

Return to: Calculated Member Builder Function List

Returns the variance of a numeric expression evaluated over a set (unbiased).

Syntax

Var(«Set»[, «Numeric Expression»])

Note Var uses the unbiased population formula. VarP uses the biased population formula.

Example

Var ({USA, CANADA, MEXICO}, Sales)


Variance

Return to: Calculated Member Builder Function List

Alias for Var.


VarianceP

Return to: Calculated Member Builder Function List

Alias for VarP.


VarP

Return to: Calculated Member Builder Function List

Returns the variance of a numeric expression evaluated over a set (biased).

Syntax

VarP(«Set»[, «Numeric Expression»])

Note VarP uses the biased population formula. Var uses the unbiased population formula.

Example

VarP({USA, CANADA, MEXICO}, Sales)


VisualTotals

Return to: Calculated Member Builder Function List

Dynamically totals child members of parent member specified in a set using a pattern for the total label in the result set.

Syntax

VisualTotals(«Set», «Pattern»)

Remarks

This function totals the values of the child members specified in «Set» only. Child members not specified in «Set» will not be included in the result. «Pattern» specifies the format for the totals label. Text for the pattern is taken literally and the asterisk (*) is the substitution character for the parent member. To display a literal asterisk, use two asterisks (**).

Note The VisualTotals function replaces the parent member of the resulting cell set. Multiple hierarchies of Parent and Child members may be specified in «Set».

Example

Assume that the Product dimension has the level Baked Goods with a child of Bread. Bread has the members Bagels, Muffins, and Sliced Bread.

In the first case, a select statement is done using

[Product].[All Products].[Food].[Baked Goods].[Bread]

as the parent member and ...[Bagels] and ...[Muffins] for the child members. The results for Bread reflect the precalculated values of all of the children of [Bread] and do not take into account that the Sliced Bread member has not been included in the resulting set.

select

  {[Measures].[Unit Sales]} on columns,

  {[Product].[All Products].[Food].[Baked Goods].[Bread],

   [Product].[All Products].[Food].[Baked Goods].[Bread].[Bagels],

   [Product].[All Products].[Food].[Baked Goods].[Bread].[Muffins]

  } on rows

from Sales

 | Unit Sales
 | 7,870.00
Bagels | 815.00
Muffins | 3,497.00

An alternate solution is to use the VisualTotals function to dynamically total the child members in the set and display an accurate value for Bread.

select

{[Measures].[Unit Sales]} on columns,

{VisualTotals({[Product].[All Products].[Food].[Baked Goods].[Bread],

  [Product].[All Products].[Food].[Baked Goods].[Bread].[Bagels],

  [Product].[All Products].[Food].[Baked Goods].[Bread].[Muffins]},

   "**SubTotal - *")

} on rows

from Sales

 | Unit Sales
*Subtotal - Bread | 4,312.00
Bagels | 815.00
Muffins | 3,497.00

The string “*SubTotal - Bread” is constructed by substituting the single asterisk substitution character with “Bread” to produce a meaningful name for the dynamically calculated total. The output asterisk is specified by the double asterisks in the substitution string.


Wtd

Return to: Calculated Member Builder Function List

A shortcut function for the PeriodsToDate function that specifies the level to be Week.

Syntax

Wtd([«Member»])

Remarks

A shortcut function to the PeriodsToDate function that defines that function’s «Level» argument to be Week. If no member is specified, then the default is Time.CurrentMember.

Wtd(«Member») is the equivalent of PeriodsToDate(Wtd, «Member»).

Example

Wtd()


Ytd

Return to: Calculated Member Builder Function List

A shortcut function for the PeriodsToDate function that specifies the level to be Year.

Syntax

Ytd([«Member»])

Remarks

A shortcut function to the PeriodsToDate function that defines that function’s «Level» argument to be Year. If no member is specified, the default is Time.CurrentMember.

Ytd(«Member») is the equivalent of PeriodsToDate(Year, «Member»).

Example

Ytd()


Choose a Dimension Table Dialog Box

Enables you to choose a dimension table from a selected data source.

This dialog box appears when you create a new dimension in the Dimension editor.

Options

Tables

Displays the tables of the selected data source.

Details

Displays a description of the data source if a data source is selected in the Tables box. Displays the columns in the table if a table is selected in the Tables box.

OK

Selects the table you have selected and returns you to the Dimension editor.

Cancel

Cancels the selection of a table and returns you to the Dimension editor without saving changes.

Help

Displays this topic in online Help.


Choose a Fact Table Dialog Box

Enables you to choose a fact table from a selected data source.

Options

Tables

Displays the tables of the selected data source.

Details

If a data source is selected in the Tables box, displays a description of the data source. If a table is selected in the Tables box, displays the columns in the table.

OK

Selects the table you have selected and closes the dialog box.

Cancel

Cancels the selection of a table and closes the dialog box.

Help

Displays this topic in online Help.


Convert to Partition Dialog Box

Enables you to convert a write-back table to a partition. This action also disables read/write permissions on the cube and deletes the data in the write-back table. (Users with disabled read/write permissions can still browse the cube.) Read permissions are not affected.

Caution It is possible to create partitioned cubes that contain incorrect data. For more information, see Partitions.

This dialog box appears when you right-click a cube, point to Write-Back Options, and then click Convert to Partition.

Options

Partition name

Type a name for the new partition.

Design the aggregations for your partition now

Select this option to start the Storage Design wizard when you click OK.

Design the aggregations later

Select this option to save the partition when you click OK but design aggregations later.

Copy the aggregation design from an existing partition

Select this option to copy the aggregation design from another partition to the new partition. In the Copy from box, select the partition from which to copy existing aggregations.

If in the future you might merge the new partition with another, copy the aggregation design of the other partition. Merged partitions must have the same aggregation design.

Process the partition when finished

Select this option to process the new partition when you click OK. This option is not available if you selected Design the aggregations for your partition now.

Advanced

Click Advanced to add a filter or to change the aggregation prefix. The Advanced Settings dialog box is displayed. For more information, click Help in the Advanced Settings dialog box.

OK

Saves changes you have made, converts the write-back table to a partition, and closes the dialog box.

Cancel

Closes the dialog box without saving changes.

Help

Displays this topic in online Help.


Create or Edit a Database Role Dialog Box

Enables you to create or edit roles to grant specific access to the selected database.

The Create a Database Role dialog box appears when you click New Role in the Manage Roles dialog box, or when you right-click the Roles folder under the Library folder in your database and then click New Role. The Edit a Database Role dialog box appears when you right-click a role in the Roles folder under the Library folder in your database and then click Edit.

Options

Role name

Type a name for the role you want to assign to the selected database. You can enter a maximum of 50 characters for the role name. If you are editing an existing role, this box displays the name of the role you are editing.

Description

Type a description of the role you are assigning. You can enter a maximum of 200 characters for the role description. If you are editing an existing role, this box displays the description of the role you are editing.

Groups and users box

Displays the groups and users already assigned to a database role. You can also add groups and users directly in this box; separate groups and users with semicolons (;).

Groups and Users button

Click this button to add new groups or users to the role.

OK

Creates or saves your changes to the database role and returns you to the OLAP Manager.

Cancel

Cancels the changes to or creation of the database role and returns you to the OLAP Manager.

Help

Displays this topic in online Help.


Cube Browser

The Cube browser enables you to view a cube’s data. The cube must be processed before you can view its data in the Cube browser.

The Cube browser is displayed when in the OLAP Manager tree view you right-click a processed cube and click Browse Data, or when you click Browse Sample Data in the last step of the Cube wizard.

The Cube browser organizes the cube data in the data grid. The default view for the data grid shows the data in table format with one dimension across the column headings and another dimension down the left column. (Measures are treated as a single dimension for this purpose.) The remaining dimensions of the cube are displayed in the slicer pane.

In this example, the data in the grid cells represents the measures according to the members that appear in the levels boxes for all the dimensions shown in the slicer pane. The specific members of the Customer Location dimension are spelled out across the grid column headings. Thus, the Unit Sales for all products, all promotion media, all promotions, all stores, and all store types in 1997 appears in the cells at the intersections of the Unit Sales row and the various columns displaying Customer Location dimension members (All Customers, Canada, Mexico, and so on).

The data in the Cube browser is actual data from a processed cube, or sample data when you are creating a cube in the Cube wizard.

Working in the Cube Browser

To browse the cube data in the data grid by any combination of dimensions, drag measures or dimensions from the slicer pane onto either axis on the data grid.

To replace a dimension on the data grid with another dimension

  • Drag the dimension from the slicer pane to the dimension in the data grid that you want to replace.

  • The pointer is in the correct position when it appears like this:

-Or-

The existing dimension moves up to the slicer pane and the new one takes its place.

To move a dimension to the data grid

  • Drag the dimension from the slicer pane to a cell below (or beside) the existing dimension.

  • The pointer is in the correct position when it appears like this:

-Or-

The new dimension appears under (or beside) the existing dimension, expanding your data grid.

To change the order of dimensions on the data grid

  • Drag the dimension and drop it on the dimension where you want it to be located.

To remove a dimension from the data grid

  • Drag the dimension you want to remove from the data grid to the slicer pane.

To drill down into a member

  • Double-click a dimension member on the data grid. If the member has a level beneath it, this next level is expanded.

Only the member you double-click is expanded. The other members retain their current levels in the data grid.

To slice through a dimension

  • To change the member in a dimension in the slicer pane, click the down arrow on the levels box, expand the levels, and then select a new member. The cube data in the data grid changes to reflect the change in the dimension member.

The Cube browser has an internal memory limit which you may reach if you attempt to browse too much data or drill down too deeply. When you reach the limit, the following message is displayed:

Unable to display current view of cube.
Unable to Allocate Memory For Flexgrid.

The limit cannot be increased by adding or allocating more memory. If you reach the limit, reduce the amount or depth of data you are attempting to browse or use another browser.


Cube Editor - Browse

The Cube editor enables you to examine and edit a cube’s structure. It appears in two views, Browse and Schema. You can switch from one view to another by clicking the Preview Cube Data or View Source Tables button or by clicking Data (Browse view) or Schema on the View menu.

The Cube editor appears when you do either of the following:

  • In the OLAP Manager tree view, right-click a cube, and then click Edit.
  • In the OLAP Manager tree view, click a cube, and then on the Action menu, click Edit.

The Browse pane in the Cube editor is identical to the Cube browser. (An exception is that you cannot view sample data in the Cube browser unless you display the Cube browser by clicking Browse Sample Data in the last step of the Cube wizard.) The Cube browser appears when in the OLAP Manager tree view you right-click a cube and then click Browse Data.

In this topic, you can read about:

  • The Browse pane.
  • The Cube editor menus.
  • The Cube editor toolbar.
  • The tree view.
  • The Properties pane.
  • Working in the Cube editor.

Browse Pane

The Browse pane organizes the cube data in the data grid. The default view for the data grid shows the data in table format with one dimension across the column headings and another dimension down the left column. (Measures are treated as a single dimension for this purpose.) The remaining dimensions of the cube are displayed in the slicer pane.

In this example, the data in the grid cells represents the measures according to the members that appear in the levels boxes for all the dimensions shown in the slicer pane. The specific members of the Customer Location dimension are spelled out across the grid column headings. Thus, the Unit Sales for all products, all promotion media, all promotions, all stores, and all store types in 1997 appears in the cells at the intersections of the Unit Sales row and the various columns displaying Customer Location dimension members (All Customers, Canada, Mexico, and so on).

The data in the Browse pane is either internally-generated sample data or the actual data from the cube.

Sample data appears when the cube has been changed since it was last processed, including changes made during your current editing session.

You can browse the sample data to check the design of your cube as you are building or editing it. You can see how the data is organized according to the current structure of the cube.

Actual data appears when the cube structure has not been changed since it was last processed.

To browse the actual data, you can drill down or slice through your data.

Working in the Browse Pane

To browse the cube data in the data grid by any combination of dimensions, drag measures or dimensions from the slicer pane onto either axis on the data grid.

To replace a dimension on the data grid with another dimension

  • Drag the dimension from the slicer pane to the dimension in the data grid that you want to replace.

  • The pointer is in the correct position when it appears like this:

-Or-

The existing dimension moves up to the slicer pane and the new one takes its place.

To move a dimension to the data grid

  • Drag the dimension from the slicer pane to a cell below (or beside) the existing dimension.

  • The pointer is in the correct position when it appears like this:

-Or-

The new dimension appears under (or beside) the existing dimension, expanding your data grid.

To change the order of dimensions on the data grid

  • Drag the dimension and drop it on the dimension where you want it to be located.

To remove a dimension from the data grid

  • Drag the dimension you want to remove from the data grid to the slicer pane.

To drill down into a member

  • Double-click a dimension member on the data grid. If the member has a level beneath it, this next level is expanded.

Only the member you double-click is expanded. The other members retain their current levels in the data grid.

To slice through a dimension

  • To change the member in a dimension in the slicer pane, click the down arrow on the levels box, expand the levels, and then select a new member. The cube data in the data grid changes to reflect the change in the dimension member.

The Browse pane has an internal memory limit which you may reach if you attempt to browse too much data or drill down too deeply. When you reach the limit, the following message is displayed:

Unable to display current view of cube.
Unable to Allocate Memory For Flexgrid.

The limit cannot be increased by adding or allocating more memory. If you reach the limit, reduce the amount or depth of data you are attempting to browse or use another browser.

Cube Editor Menus

Menu | Option | Description
File | New Cube - Wizard | Creates a new cube using the Cube wizard.
 | New Cube - Editor | Creates a new cube using the Cube editor.
 | Save | Saves the cube.
 | Save As | Saves the cube under a different name.
 | Exit | Closes the Cube editor.
Edit | Rename | Renames the selected object.
 | Delete | Deletes the selected object.
 | Remove Join | Removes all joins from selected column (Schema pane only).
View | Schema | Displays the Schema pane.
 | Data | Displays the Browse pane.
 | Properties | Expands the Properties pane.
Insert | Tables | Adds a table to the cube.
 | Dimension - Manager | Adds a dimension using the Dimension Manager.
 | Dimension - New Private | Adds a new private dimension.
 | Level | Adds a new level.
 | Measure | Adds a new measure.
 | Calculated Member | Adds a calculated member using the calculated member builder.
 | Join | Adds a join to selected column (Schema pane only).
Tools | Process Cube | Processes the cube.
 | Design Storage | Designs aggregations and storage using the Storage Design wizard.
 | Count Dimension Members | Counts the number of members in a dimension.
 | Validate Cube Structure | Verifies that the cube structure doesn’t contain invalid components that would prevent processing of the cube.
 | Optimize Schema | Simplifies a cube’s schema for maximum performance by removing unnecessary joins and other inefficient processes.
 | Manage Roles | Manages roles and users.
Help | Help on Cube Editor | Brings up this Help topic.
 | Contents and Index | Opens Microsoft® SQL Server™ OLAP Services product documentation.

Toolbar

Tree View

The tree view previews the structure of the cube in a hierarchical tree. Right-click an object to see a shortcut menu for that object.

Right-click | Shortcut menu option | Description
Cube name | New Cube | Adds a new cube.
 | Process Cube | Processes the cube.
 | Dimension Manager | Opens the Dimension Manager.
 | New Private Dimension | Adds a new private dimension.
 | New Measure | Adds a new measure.
Dimensions folder | Dimension Manager | Opens the Dimension Manager.
 | New Private Dimension | Adds a new private dimension.
Dimension | Dimension Manager | Opens the Dimension Manager.
 | New Private Dimension | Adds a new private dimension.
 | Remove | Removes the dimension.
Level | Dimension Manager | Opens the Dimension Manager.
 | New Private Dimension | Adds a new private dimension.
Measures folder | New Measure | Adds a new measure.
Measure | New Measure | Adds a new measure.
 | Delete | Deletes the measure.
 | Rename | Renames the measure.
Calculated members folder | New Calculated Member | Adds a new calculated member.
Calculated member | New Calculated Member | Adds a new calculated member.
 | Edit | Edits the calculated member.
 | Delete | Deletes the calculated member.
 | Rename | Renames the calculated member.

Properties Pane

The Properties pane displays the properties of a selected object in the tree view. Each type of object (cube, dimension, levels, and measures) contains a different set of properties. Use the Properties pane to modify the property settings for any selected object.

To expand the Properties pane for an object in the tree view

  • Click the object, and then click the arrow on the Properties pane,

    -Or-

  • On the View menu, click Properties.

Note The MemberKeyColumn property for a dimension level can refer to a column or to a value derived from a column, such as a formula that extracts the year value from a date-formatted column. However, the column or the value derived from the column must be a string or a number.

For more information about properties, see Properties Cross-Reference.

Working in the Cube Editor

The following functions can be performed in different ways. Choose the option that is easiest for you.

To select a different cube

  • In the Cube box, select the cube you want to edit.

To create a new cube using the cube wizard

  • On the File menu, point to New Cube, and then click Wizard.

    -Or-

  • Click the New Cube button on the toolbar.

To create a new cube using the Cube editor

  • On the File menu, point to New Cube, and then click Editor.

    -Or-

  • In the Cube list, select <New>.

    -Or-

  • Right-click a cube in the tree view, and then click New Cube.

To save the current cube

  • On the File menu, click Save.

    -Or-

  • Click the Save button on the toolbar.

To save the current cube under a different name

  1. On the File menu, click Save As.
  2. Enter a name in the Cube Name box, and then click OK.

To add a table

  • On the Insert menu, click Tables.

    -Or-

  • Click the Insert Table button on the toolbar.

To access the Dimension manager

  • On the Insert menu, point to Dimension, and then click Manager.

    -Or-

  • Click the Insert Dimension button on the toolbar.

    -Or-

  • In the tree view, right-click either 1) a cube name, 2) the Dimensions folder, or 3) a dimension name, and then click Dimension Manager.

To add a new private dimension

  1. On the Insert menu, point to Dimension, and then click New Private.
  2. In the tree view, right-click either 1) a cube name, 2) the Dimensions folder, or 3) a dimension name, and then click New Private Dimension.

To remove a dimension

  • In the tree view, right-click the dimension, and then click Remove.

To add a measure

  • On the Insert menu, click Measure.

    -Or-

  • Click the Insert Measure button on the toolbar.

    -Or-

  • In the tree view, right-click either 1) the Measures folder or 2) a measure name, and then click New Measure.

To delete a measure

  • In the tree view, right-click the measure, and then click Delete.

To rename a measure

  1. In the tree view, right-click the measure, and then click Rename.
  2. Type the new name over the old name, and then press ENTER.

To add a calculated member

  • On the Insert menu, click Calculated Member.

    -Or-

  • Click the Insert Calculated Member button on the toolbar.

    -Or-

  • In the tree view, right-click either 1) the Calculated Members folder or 2) a calculated member name, and then click New Calculated Member.

To edit a calculated member

  • In the tree view, right-click the calculated member, and then click Edit.

To delete a calculated member

  • In the tree view, right-click the calculated member, and then click Delete.

To process the cube

  • On the Tools menu, click Process Cube.

To design aggregations and storage

  • On the Tools menu, click Design Storage.

To count dimension members

  • On the Tools menu, click Count Dimension Members.

To validate the cube structure

  • On the Tools menu, click Validate Cube Structure.

To optimize the cube schema

  • On the Tools menu, click Optimize Schema.

To manage roles

  • On the Tools menu, click Manage Roles.

    -Or-

  • Click the Manage Roles button on the toolbar.

To view the Schema pane

  • On the View menu, click Schema.

    -Or-

  • Click the View Source Tables button on the lower toolbar.

To expand the Properties pane

  • On the View menu, click Properties.

    -Or-

  • Click the arrow on the Properties pane below the tree view.

To edit the properties of an object

  • In the Properties pane, place the pointer in the desired cell and type in the new value, or select a value from the list, if a list is presented.

To close the Cube editor

  • On the File menu, click Exit.


Cube Editor - Schema

Enables you to examine and edit your cube’s structure. It appears in two views, Browse and Schema. You can switch from one view to another by clicking the Preview Cube Data button or the View Source Tables button. You can also click Data or Schema on the View menu.

The Cube editor appears when you do either of the following:

  • In the OLAP Manager tree view, right-click a cube, and then click Edit.
  • In the OLAP Manager tree view, click a cube, and then on the Action menu, click Edit.

In this topic, you can read about:

  • The Schema pane.
  • The Cube editor menus.
  • The Cube editor toolbar.
  • The tree view.
  • The Properties pane.
  • Working in the Cube editor.

Schema Pane

In the Cube editor Schema pane, you can organize the structure of a cube in a graphical display, add additional measures and shared dimensions, and create private dimensions.

The Schema pane displays the cube’s fact table with a yellow title bar and all dimension tables with blue title bars. Joins are depicted by lines connecting the key columns between the tables.

Lengthen a selected table window vertically or use the scroll bars to view all columns in the table. You can also widen the table window to view long column names.

Note Changing the structure of a cube causes the results of previous cube processing to be invalidated. After a cube’s structure has changed, you must process the cube to re-create its data.

Working in the Schema Pane

This section lists the actions that can be performed in the Schema pane. Many actions can be performed in multiple ways. For example, an action can be accomplished by a drag-and-drop procedure, or by right-clicking an object and then clicking an item on the shortcut menu.

To remove a table

  • Right-click the title bar of the table, and then click Remove.

To add a new table

  • Right-click anywhere in the Schema pane, and then click Insert Tables. A join using the key column is automatically created between this new dimension table and the fact table.

To browse the data in a table

  • Right-click the title bar of the table, and then click Browse Data.

To create a join between two tables

  • Select the key column name in the first table, and then drag it to the corresponding key column name in the second table.

To remove a join between two tables

  • Right-click the line depicting the join, and then click Remove.

To replace the fact table

  • Right-click an empty section of the Schema pane, and then click Replace Fact Table.

    The schema is refreshed with the new fact table. Joins with the existing dimension tables are constructed from the common key columns in the corresponding tables.

To add a new dimension

You can add a new cube dimension from any column contained in a table.

  • Right-click the column, and then click Insert as Dimension.

    -Or-

  • Double-click the column. In the Map the Column dialog box, click Dimension, and then click OK.

    -Or-

  • Drag the column name from the tree view to the Dimensions folder.

    Note If you add or delete dimensions in your cube, you must redesign the aggregations and reprocess the cube.

To add a new measure

You can add a new measure from any numeric or time column contained in the fact table. Each cube must contain at least one measure.

  • Right-click the column, and then click Insert As Measure.

    -Or-

  • Double-click the column. In the Map the Column dialog box, click Measure, and then click OK.

    -Or-

  • Drag the column name from the tree view to the Measures folder.

    Note If you add or delete measures in your cube, you must redesign the aggregations and reprocess the cube.

To delete an existing measure

  • In the Cube editor tree view, right-click a measure, and then click Delete.

To switch to the Browse pane

  • Click the Preview Cube Data button on the lower toolbar.

Cube Editor Menus

Menu | Option | Description
File | New Cube - Wizard | Creates a new cube using the Cube wizard.
 | New Cube - Editor | Creates a new cube using the Cube editor.
 | Save | Saves the cube.
 | Save As | Saves the cube under a different name.
 | Exit | Closes the Cube editor.
Edit | Rename | Renames the selected object.
 | Delete | Deletes the selected object.
 | Remove Join | Removes all joins from the selected column.
View | Schema | Displays the Schema pane.
 | Data | Displays the Browse pane.
 | Properties | Expands the Properties pane.
Insert | Tables | Adds a table to the cube.
 | Dimension - Manager | Adds a dimension using the Dimension Manager.
 | Dimension - New Private | Adds a new private dimension.
 | Level | Adds a new level.
 | Measure | Adds a new measure.
 | Calculated Member | Adds a calculated member.
 | Join | Adds a join to the selected column.
Tools | Process Cube | Processes the cube.
 | Design Storage | Designs aggregations and storage using the Storage Design wizard.
 | Count Dimension Members | Counts the number of members in a dimension.
 | Validate Cube Structure | Verifies that the cube structure doesn’t contain invalid components that would prevent processing of the cube.
 | Optimize Schema | Simplifies a cube’s schema for maximum performance by removing unnecessary joins and other inefficient processes.
 | Manage Roles | Manages roles and users.
Help | Help on Cube Editor | Displays this Help topic.
 | Contents and Index | Opens Microsoft® SQL Server™ OLAP Services Books Online.

Toolbar

Tree View

The tree view previews the structure of the cube in a hierarchical tree. Right-click an object to see a shortcut menu for that object.

Right-click | Shortcut menu option | Description
Cube name | New Cube | Adds a new cube.
 | Process Cube | Processes the cube.
 | Dimension Manager | Opens the Dimension Manager.
 | New Private Dimension | Adds a new private dimension.
 | New Measure | Adds a new measure.
Dimensions folder | Dimension Manager | Opens the Dimension Manager.
 | New Private Dimension | Adds a new private dimension.
Dimension | Dimension Manager | Opens the dimension manager.
 | New Private Dimension | Adds a new private dimension.
 | Remove | Removes the dimension.
Level | Dimension Manager | Opens the Dimension Manager.
 | New Private Dimension | Adds a new private dimension.
Measures folder | New Measure | Adds a new measure.
Measure | New Measure | Adds a new measure.
 | Delete | Deletes the measure.
 | Rename | Renames the measure.
Calculated members folder | New Calculated Member | Adds a new calculated member.
Calculated member | New Calculated Member | Adds a new calculated member.
 | Edit | Edits the calculated member.
 | Delete | Deletes the calculated member.
 | Rename | Renames the calculated member.

Properties Pane

The Properties pane displays the properties of a selected object in the tree view. Each type of object (cube, dimension, levels, and measures) contains a different set of properties. Use the Properties pane to modify the property settings for any selected object.

To expand the Properties pane for an object in the tree view

  • Click an object, and then click the arrow on the Properties pane.

    -Or-

  • On the View menu, click Properties.

Note The MemberKeyColumn property for a dimension level can refer to a column or to a value derived from a column, such as a formula that extracts the year value from a date-formatted column. However, the column or the value derived from the column must be a string or a number.

For more information about properties, see Properties Cross-Reference.

Working in the Cube Editor

This section lists the actions that can be performed in the Cube editor. Many actions can be performed in multiple ways. For example, an action can be accomplished either by clicking a menu item, by clicking a button on the toolbar, or by right-clicking an object and then clicking an item on the shortcut menu.

To select a different cube

  • In the Cube box, click the desired cube.

To create a new cube using the Cube wizard

  • On the File menu, point to New Cube, and then click Wizard.

    -Or-

  • Click the New Cube button on the toolbar.

To create a new cube using the Cube editor

  • On the File menu, point to New Cube, and then click Editor.

    -Or-

  • In the Cube box, click <New>.

    -Or-

  • Right-click a cube in the tree view, and then click New Cube.

To save the current cube

  • On the File menu, click Save.

    -Or-

  • Click the Save button on the toolbar.

To save the current cube under a different name

  1. On the File menu, click Save As.
  2. Enter a name in the Cube Name box, and then click OK.

To add a table

  • On the Insert menu, click Tables.

    -Or-

  • Click the Insert Table button on the toolbar.

To access the Dimension Manager

  • On the Insert menu, point to Dimension, and then click Manager.

    -Or-

  • Click the Insert Dimension button on the toolbar.

    -Or-

  • In the tree view, right-click either 1) a cube name, 2) the Dimensions folder, or 3) a dimension name, and then click Dimension Manager.

To add a new private dimension

  • On the Insert menu, point to Dimension, and then click New Private.

    -Or-

  • In the tree view, right-click either 1) a cube name, 2) the Dimensions folder, or 3) a dimension name, and then click New Private Dimension.

To remove a dimension

  • In the tree view, right-click a dimension, and then click Remove.

To add a measure

  • On the Insert menu, click Measure.

    -Or-

  • Click the Insert Measure button on the toolbar.

    -Or-

  • In the tree view, right-click either 1) the Measures folder or 2) a measure name, and then click New Measure.

To delete a measure

  • In the tree view, right-click a measure, and then click Delete.

To rename a measure

  1. In the tree view, right-click a measure, and then click Rename.
  2. Type the new name over the old name, and then press ENTER.

To add a calculated member

  • On the Insert menu, click Calculated Member.

    -Or-

  • Click the Insert Calculated Member button on the toolbar.

    -Or-

  • In the tree view, right-click either 1) the Calculated Members folder or 2) a calculated member name, and then click New Calculated Member.

To edit a calculated member

  • In the tree view, right-click a calculated member, and then click Edit.

To delete a calculated member

  • In the tree view, right-click a calculated member, and then click Delete.

To process the cube

  • On the Tools menu, click Process Cube.

To design aggregations and storage

  • On the Tools menu, click Design Storage.

To count dimension members

  • On the Tools menu, click Count Dimension Members.

To validate the cube structure

  • On the Tools menu, click Validate Cube Structure.

To optimize the cube schema

  • On the Tools menu, click Optimize Schema.

To manage roles

  • On the Tools menu, click Manage Roles.

    -Or-

  • Click the Manage Roles button on the toolbar.

To view the Browse pane

  • On the View menu, click Data.

    -Or-

  • On the lower toolbar, click the Preview Cube Data button.

To view the Properties pane

  • On the View menu, click Properties.

    -Or-

  • Click the arrow on Properties below the tree view.

To edit the properties of an object

  • In the Properties pane, place the pointer in the desired cell and type in the new value, or select a value from the list, if a list is presented.

To close the Cube editor

  • On the File menu, click Exit.


Database Dialog Box

Enables you to create a new OLAP database or change the description of an existing OLAP database.

This dialog box appears when you right-click a database or a server in the OLAP Manager tree view and then click New Database. It also appears when you right-click a database and then click Edit.

Options

Database name

Type a name for your OLAP database. This option is not available if you are editing an existing OLAP database.

Description

Type a short description of your database. You can enter a maximum of 200 characters for the database description.

OK

Creates the database and returns you to the OLAP Manager tree view.

Cancel

Cancels the creation of your database and returns you to the OLAP Manager tree view.

Help

Displays this topic in Help.


Dimension Browser

Enables you to examine a dimension including its levels, members, member properties, and member property values.

The Dimension browser is displayed when in the OLAP Manager tree view you right-click a shared dimension or virtual dimension and then click Browse Dimension Data.

The Dimension browser displays the dimension in a graphical format, allowing you to easily view a multilevel dimension hierarchy. The Dimension browser is divided into two boxes.

The Dimension Members box displays the dimension members in a tree format. Expand or collapse individual levels to browse them.

The Member properties box lists the member properties of the member selected in the Dimension Members box. The Member properties box contains all user-defined member properties for the selected member. Each member property has its name shown in the first column of the box and its value in the second column.


Dimension Editor - Browse

Enables you to examine and edit a dimension and its levels. It appears in two views, Browse and Schema. You can switch from one view to another by clicking the Preview Dimension Data button or the View Source Tables button. You can also click Data or Schema on the View menu.

The Dimension editor appears when you do either of the following:

  • In the OLAP Manager, in the Library folder, open the Shared Dimensions folder. Right-click a dimension, and then click Edit.
  • In the OLAP Manager, in the Library folder, open the Shared Dimensions folder. Click a dimension, and then on the Action menu, click Edit.

The Dimension browser is identical to the Browse pane in the Dimension editor. It appears when you do the following:

  • In the OLAP Manager, in the Library folder, open the Shared Dimensions folder. Right-click a dimension, and then click Browse Dimension Data.

In this topic, you can read about:

  • The Browse pane.
  • The Dimension editor menus.
  • The Dimension editor toolbar.
  • The tree view.
  • The Properties pane.
  • Working in the Dimension editor.

Browse Pane

The Dimension editor Browse pane displays the dimension in a graphical format, allowing you to easily view multilevel dimension hierarchies. The Browse pane is divided vertically into two panes. The left pane displays the dimension members in a tree format. Expand or collapse individual levels to browse them.

The right pane contains a list of the member properties of the member selected in the left pane. The list of member properties contains all user-defined member properties for the selected member.

Each member property has its name shown in the first column of the list and its value in the second column of the list. The member properties are sorted in the same order as in the tree view.

Dimension Editor Menus

Menu | Option | Description
File | New Dimension - Wizard | Creates a new dimension using the Dimension wizard.
 | New Dimension - Editor | Creates a new dimension using the Dimension editor.
 | Save | Saves the dimension.
 | Save As | Saves the dimension under a different file name.
 | Exit | Closes the Dimension editor.
Edit | Rename | Renames the selected object.
 | Delete | Deletes the selected object.
 | Remove Join | Removes all joins from selected column (Schema pane only).
View | Schema | Displays the Schema pane.
 | Data | Displays the Browse pane.
 | Properties | Expands the Properties pane.
Insert | Tables | Adds a table to the dimension.
 | Level | Adds a new level.
 | Member Property | Adds a new member property.
 | Join | Adds a join to selected column (Schema pane only).
Tools | Process Dimension | Processes the dimension.
 | Count Dimension Members | Counts the number of members in a dimension.
 | Validate Dimension Structure | Verifies that the dimension structure doesn't contain invalid components that would prevent processing of the dimension.
Help | Help on Dimension Editor | Displays this Help topic.
 | Contents and Index | Opens Microsoft® SQL Server™ OLAP Services Books Online.

Toolbar

Tree View

The tree view previews the structure of your dimension in a hierarchical tree. In the tree view, right-click an object to see a shortcut menu for that object.

Right-click | Shortcut menu option | Description
Dimension name | New Dimension | Adds a new dimension.
 | Process Dimension | Processes the dimension.
 | New Level | Adds a new level.
Level | New Level | Adds a new level.
 | New Member Property | Adds a new member property.
 | Delete | Deletes the level.
 | Rename | Renames the level.
Member Property Folder | New Member Property | Adds a new member property.
Member Property | New Member Property | Adds a new member property.
 | Delete | Deletes the member property.
 | Rename | Renames the member property.

Properties Pane

The Properties pane displays the properties of a selected object in the tree view. Each type of object (dimension, level, or member property) contains a different set of properties. Use the Properties pane to modify the property settings for the selected object.

To expand the Properties pane for an object in the tree view

  • Select the object, and then click the arrow on the Properties pane.

    -Or-

  • On the View menu, click Properties. The Properties pane displays the properties for the object.

Note The MemberKeyColumn property for a dimension level can refer to a column or to a value derived from a column, such as a formula that extracts the year value from a date-formatted column. However, the column or the value derived from the column must be a string or a number.

For more information about properties, see Properties Cross-Reference.

Working in the Dimension Editor

This section lists the actions that can be performed in the Dimension editor. Many actions can be performed in multiple ways. For example, an action can be accomplished either by clicking a menu item, by clicking a button on the toolbar, or by right-clicking an object and then clicking an item on the shortcut menu.

To view a different dimension

  • Click the down arrow on the Dimension list on the toolbar, and then click a dimension.

To create a new dimension using the Dimension wizard

  • On the File menu, point to New Dimension, and then click Wizard.

    -Or-

  • Click the New Dimension button on the toolbar.

To create a new dimension using the Dimension editor

  • On the File menu, point to New Dimension, and then click Editor.

    -Or-

  • On the Dimension list on the toolbar, click New.

    -Or-

  • In the tree view, right-click a dimension, and then click New Dimension.

To save the current dimension

  • On the File menu, click Save.

    -Or-

  • Click the Save button on the toolbar.

To save the current dimension under a different name

  1. On the File menu, click Save As.
  2. In the New Dimension Name dialog box, enter a name in the Dimension Name box, and then click OK.

To add a table

  • On the Insert menu, click Tables.

    -Or-

  • Click the Insert Table button on the toolbar.

Note Adding a table automatically switches you to the Schema pane.

To add a level

  • On the Insert menu, click Level.

    -Or-

  • Click the Insert Level button on the toolbar.

    -Or-

  • In the tree view, right-click a dimension, and then click New Level.

    -Or-

  • In the tree view, right-click a level, and then click New Level.

To delete a level

  • In the tree view, click a level, and then on the Edit menu, click Delete.

    -Or-

  • In the tree view, right-click a level, and then click Delete.

To rename a level

  • In the tree view, click a level, and then on the Edit menu, click Rename.

    -Or-

  • In the tree view, right-click a level, and then click Rename.

To add a member property

  • On the Insert menu, click Member Property.

    -Or-

  • In the tree view, click a level, member property folder, or member property, and then click the Insert Member Property button on the toolbar.

    -Or-

  • In the tree view, right-click a level, member property folder, or member property, and then click New Member Property.

To delete a member property

  • In the tree view, click a member property, and then on the Edit menu, click Delete.

    -Or-

  • In the tree view, right-click a member property, and then click Delete.

To rename a member property

  • In the tree view, click a member property, and then on the Edit menu, click Rename.

    -Or-

  • In the tree view, right-click a member property, and then click Rename.

To process a dimension

  • On the Tools menu, click Process Dimension.

    -Or-

  • In the tree view, right-click a dimension, and then click Process Dimension.

To count dimension members

  • On the Tools menu, click Count Dimension Members.

To validate a dimension structure

  • On the Tools menu, click Validate Dimension Structure.

To view the Schema pane

  • On the View menu, click Schema.

    -Or-

  • On the lower toolbar, click the View Source Tables button.

To expand the Properties pane

  • On the View menu, click Properties.

    -Or-

  • Click the down arrow on the Properties pane.

To edit the properties of an object

  • In the Properties pane, place the pointer in a cell and then type in the new value, or select a value from the list, if a list is presented.

To close the Dimension editor

  • On the File menu, click Exit.


Dimension Editor - Schema

Enables you to examine and edit a dimension and its levels. It appears in two views, Browse and Schema. You can switch from one view to another by clicking the Preview Dimension Data button or the View Source Tables button. You can also click Data or Schema on the View menu.

The Dimension editor appears when you do either of the following:

  • In the OLAP Manager, in the Library folder, open the Shared Dimensions folder. Right-click a dimension, and then click Edit.
  • In the OLAP Manager, in the Library folder, open the Shared Dimensions folder. Click a dimension, and then on the Action menu, click Edit.

In this topic, you can read about:

  • The Schema pane.
  • The Dimension editor menus.
  • The Dimension editor toolbar.
  • The tree view.
  • The Properties pane.
  • Working in the Dimension editor.

Schema Pane

In the Dimension editor Schema pane, you can organize the structure of the dimension in a graphical display, add additional tables and levels, and browse the data in the dimension tables.

The Schema pane displays the dimension tables with blue title bars. Joins are depicted by lines connecting the key columns between multiple tables.

Lengthen a selected table window vertically, or use the scroll bars to view all columns in the table. You can also widen the table window to view long column names.

Note Changing the structure of a dimension causes the results of previous dimension processing to be invalidated. After a dimension’s structure has changed, you must process the dimension to re-create the data.

Working in the Schema pane

This section lists the actions that can be performed in the Schema pane. Many actions can be performed in multiple ways. For example, an action can be accomplished by a drag-and-drop procedure, or by right-clicking an object and then clicking an item on the shortcut menu.

To add a new table

  • Right-click anywhere in the Schema pane, and then click Insert Tables.

To remove a table

  • Right-click the title bar of a table, and then click Remove.

To browse the data in a table

  • Right-click the title bar of a table, and then click Browse Data.

To create a join between two tables

  • Select the key column name in the first table, and then drag it over the corresponding key column name in the second table.

To remove a join between two tables

  • Right-click the line depicting the join, and then click Remove.

To switch to the Browse pane

  • On the lower toolbar, click the Preview Dimension Data button.

Dimension Editor Menus

Menu | Option | Description
File | New Dimension - Wizard | Creates a new dimension using the Dimension wizard.
 | New Dimension - Editor | Creates a new dimension using the Dimension editor.
 | Save | Saves the dimension.
 | Save As | Saves the dimension under a different name.
 | Exit | Closes the Dimension editor.
Edit | Rename | Renames the selected object.
 | Delete | Deletes the selected object.
 | Remove Join | Removes all joins from the selected column.
View | Schema | Displays the Schema pane.
 | Data | Displays the Browse pane.
 | Properties | Expands the Properties pane.
Insert | Tables | Adds a table to the dimension.
 | Level | Adds a new level.
 | Member Property | Adds a new member property.
 | Join | Adds a join to the selected column.
Tools | Process Dimension | Processes the dimension.
 | Count Dimension Members | Counts the number of members in a dimension.
 | Validate Dimension Structure | Verifies that the dimension structure doesn’t contain invalid components that would prevent processing of the dimension.
Help | Help on Dimension Editor | Displays this Help topic.
 | Contents and Index | Opens the Microsoft® SQL Server™ OLAP Services Books Online.

Toolbar

Tree View

The tree view previews the structure of your dimension in a hierarchical tree. Right-click an object to see a shortcut menu for that object.

Right-click | Shortcut menu option | Description
Dimension name | New Dimension | Adds a new dimension.
 | Process Dimension | Processes the dimension.
 | New Level | Adds a new level.
Level | New Level | Adds a new level.
 | New Member Property | Adds a new member property.
 | Delete | Deletes the level.
 | Rename | Renames the level.
Member Property Folder | New Member Property | Adds a new member property.
Member Property | New Member Property | Adds a new member property.
 | Delete | Deletes the member property.
 | Rename | Renames the member property.

Properties Pane

The Properties pane displays the properties of a selected object in the tree view. Each type of object (dimension, level, or member property) contains a different set of properties. Use the Properties pane to modify the property settings for the selected object.

To expand the Properties pane for an object in the tree view

  • Select an object, and then click the arrow on the Properties pane.

    -Or-

  • On the View menu, click Properties.

Note The MemberKeyColumn property for a dimension level can refer to a column or to a value derived from a column, such as a formula that extracts the year value from a date-formatted column. However, the column or the value derived from the column must be a string or a number.

For more information about properties, see Properties Cross-Reference.

Working in the Dimension Editor

This section lists the actions that can be performed in the Dimension editor. Many actions can be performed in multiple ways. For example, an action can be accomplished either by clicking a menu item, by clicking a button on the toolbar, or by right-clicking an object and then clicking an item on the shortcut menu.

To view a different dimension

  • Click the down arrow on the Dimension list on the toolbar, and then click the desired dimension.

To create a new dimension using the Dimension wizard

  • On the File menu, point to New Dimension, and then click Wizard.

    -Or-

  • Click the New Dimension button on the toolbar.

To create a new dimension using the Dimension editor

  • On the File menu, point to New Dimension, and then click Editor.

    -Or-

  • On the Dimension list on the toolbar, click New.

    -Or-

  • In the tree view, right-click a dimension, and then click New Dimension.

To save the current dimension

  • On the File menu, click Save.

    -Or-

  • Click the Save button on the toolbar.

To save the current dimension under a different name

  1. On the File menu, click Save As.
  2. In the New Dimension Name dialog box, enter a name in the Dimension Name box, and then click OK.

To add a table

  • On the Insert menu, click Tables.

    -Or-

  • Click the Insert Table button on the toolbar.

To add a level

  • On the Insert menu, click Level.

    -Or-

  • Click the Insert Level button on the toolbar.

    -Or-

  • In the tree view, right-click a dimension, and then click New Level.

    -Or-

  • In the tree view, right-click a level, and then click New Level.

To delete a level

  • In the tree view, click a level, and then on the Edit menu, click Delete.

    -Or-

  • In the tree view, right-click a level, and then click Delete.

To rename a level

  • In the tree view, click a level, and then on the Edit menu, click Rename.

    -Or-

  • In the tree view, right-click a level, and then click Rename.

To add a member property

  • On the Insert menu, click Member Property.

    -Or-

  • In the tree view, click a level, member property folder, or member property, and then click the Insert Member Property button on the toolbar.

    -Or-

  • In the tree view, right-click a level, member property folder, or member property, and then click New Member Property.

To delete a member property

  • In the tree view, click a member property, and then on the Edit menu, click Delete.

    -Or-

  • In the tree view, right-click a member property, and then click Delete.

To rename a member property

  • In the tree view, click a member property, and then on the Edit menu, click Rename.

    -Or-

  • In the tree view, right-click a member property, and then click Rename.

To process a dimension

  • On the Tools menu, click Process Dimension.

    -Or-

  • In the tree view, right-click the dimension, and then click Process Dimension.

To count dimension members

  • On the Tools menu, click Count Dimension Members.

To validate a dimension structure

  • On the Tools menu, click Validate Dimension Structure.

To view the Browse pane

  • On the View menu, click Data.

    -Or-

  • On the lower toolbar, click the Preview Dimension Data button.

To expand the Properties pane

  • On the View menu, click Properties.

    -Or-

  • Click the down arrow on the Properties pane.

To edit the properties of an object

  • In the Properties pane, place the pointer in a cell and then type in the new value, or select a value from the list, if a list is presented.

To close the Dimension editor and return to the tree view of OLAP Manager

  • On the File menu, click Exit.


Dimension Manager

Enables you to edit or create new dimensions for your cube.

This dialog box appears when in the Cube editor, you right-click the Dimensions folder or a dimension and then click Dimension Manager.

You can choose from previously-defined dimensions or start the Dimension wizard to create a new dimension. If you create a new dimension, you can define it as either “shared” or “private” (available only to the cube you are creating).

The previously defined dimensions available are listed under Shared dimensions.

For more information about dimensions, see Dimensions.

To select dimensions

  • Select dimensions under Shared dimensions. Use the buttons provided to move dimensions to the list under Cube dimensions.

    To add a shared dimension to a cube, click the dimension, and then click “>“ (Add).

    To remove a cube dimension from a cube, click the dimension, and then click “<“ (Remove).

    To add all available shared dimensions to a cube, click “>>“ (Add All).

    To remove all dimensions from a cube, click “<<“ (Remove All).

Options

New Dimension

Choose this option to start the Dimension wizard, which helps you create a new dimension.


Edit Virtual Dimension Dialog Box

To edit a virtual dimension you select from an existing dimension the new member property on which the virtual dimension will be based.

To select a member property for the virtual dimension

  1. In the Member properties box, expand the dimensions to display available member properties.
  2. Click the new member property on which the virtual dimension will be based.
  3. Click OK.


Manage Roles Dialog Box

Enables you to select database roles for a cube.

This dialog box appears when you right-click a cube and then click Manage Roles.

Options

Database roles

Displays the role names that are available for the selected cube. You can view existing database roles that have been defined in the Roles folder under the Library folder in the OLAP Manager tree view.

Cube access

When you select a name under Database roles, it appears in the Name column under Cube access, along with the permission properties assigned to that role.

  • To add a role to a cube, click the role, and then click “>“ (Add).
  • To remove an assigned role from a cube, click the role, and then click “<“ (Remove).
  • To add all displayed roles to a cube, click “>>“ (Add All).
  • To remove all assigned roles from a cube, click “<<“ (Remove All).

New Role

Click this button to define a new database role.

Grant read/write permission

Select this option to allow users in the role to update browsed cube data. Updates will be recorded in the cube’s write-back table.

Read/write permissions are effective only if the cube is write-enabled in the Write Enable dialog box. Otherwise, read/write permissions function as read permissions.

OK

Saves changes you have made and returns you to the OLAP Manager tree view.

Cancel

Returns you to the OLAP Manager tree view without making changes.

Help

Displays this topic in online Help.


Map The Column Dialog Box

Enables you to create a new level in a dimension, new dimension, or new measure in the Cube editor.

This dialog box appears when you double-click a column in a table in the Schema pane of the Cube editor.

Options

Level in Dimension

Select this option to create a new level in the private dimension you select from the drop-down list. This option is available only when the cube contains a private dimension.

Dimension

Select this option to create a new private dimension.

Measure

Select this option to create a new measure from the fact table of this cube.

OK

Creates the new object and returns you to the Cube editor.

Cancel

Cancels the creation of the object and returns you to the Cube editor.

Help

Displays this topic in online Help.


Merge Partitions Dialog Box

Enables you to merge two partitions. The data and aggregations of the partition you selected in the OLAP Manager tree view are consolidated into the partition you select in the Into this partition box, and the first partition is then deleted.

This dialog box appears when in the OLAP Manager tree view you expand the Partitions folder for a cube, right-click a partition, and then click Merge. This command is available only when more than one partition is defined in a cube.

Caution When you merge partitions that have different fact tables, you must manually merge the fact tables so the target partition’s fact table contains all the facts required for the combined partition. For more information, see Merging Partitions and its subtopics in the Administrator’s Guide.

Options

Merge this partition

Displays the partition you selected in the OLAP Manager tree view. This is the source partition. After merging, it is deleted.

Into this partition

Select the target partition you want the source partition to be merged with. After merging, this partition is the one that remains.

Merge

Consolidates the specified partitions. The newly merged partition is processed after you click Merge. Processing status of the partition is displayed in the Process dialog box.

Cancel

Cancels the merging of partitions and returns you to the OLAP Manager tree view.

Help

Displays this topic in online Help.


Process Dialog Box

Enables you to monitor processing operations while processing your cube, dimension, or database.

This dialog box appears at various times when you process, incrementally update, or refresh the data in a cube or dimension. It also appears when you process a database.

Options

Status bar

Displays the status of processing operations on the cube, dimension, or database.

Stop

Halts and cancels processing operations on the cube, dimension, or database.

Reprocess

Restarts processing operations on the cube, dimension, or database from the beginning.

View Details

Displays the View Trace Line dialog box. Click a message and then click View Details to see details about the message.

Close

Closes the dialog box.

Help

Displays this topic in Help.


Process a Cube Dialog Box

Enables you to choose how to process a cube.

This dialog box appears when you right-click a cube in the OLAP Manager tree view, and then click Process.

Options

Incremental update

Select this option to append new data from the data warehouse to one of your cube’s partitions and update aggregations. An incremental update does not affect the existing data that has already been processed and usually requires significantly less time than processing with the Process option.

An incremental update can be performed while users continue to query the cube; after the update has completed, users will have access to the additional data without having to reconnect.

This option is not applicable if the cube’s structure has changed, or if the data from which the cube was created has changed.

Caution This option updates a partition. Incorrect use of partitions can result in inaccurate cube data. For more information, see Partitions and its subtopics in the Administrator’s Guide.

Refresh data

Select this option to cause the cube’s data to be cleared and reloaded and aggregations recalculated. This option is applicable when the underlying data in the data warehouse has changed but the cube’s structure remains the same.

A refresh can be performed while users continue to query the cube; after the refresh has completed, users will have access to the refreshed data without having to reconnect.

Process

Select this option to completely rebuild your cube after you have made structural changes to it such as adding a dimension, dimension level, or measure. This option restructures the cube based on its current definitions and recalculates and reloads its data. This option can take a long time.

After you process a cube with this option, users must reconnect to the server computer to continue working with the cube.

Caution If a shared dimension’s structure is updated and saved but not processed, it will automatically be processed when any cube incorporating the dimension is processed with this option. At that time any other cubes that incorporate the dimension immediately become unavailable to users and must be processed before they can be used again.

OK

Starts the operation you have chosen.

Cancel

Cancels the dialog box without processing the cube.

Help

Displays this topic in Help.


Process a Dimension Dialog Box

Enables you to process a shared dimension.

This dialog box appears when in the OLAP Manager tree view, in the Shared Dimensions folder, you right-click a shared dimension, and then click Process.

Options

Incremental update

Select this option to append new dimension members to your shared dimension. This option is appropriate when the structure and relationship of the dimension levels and members have not changed, but new members (that is, rows) have been added to the dimension table.

A cube that incorporates a shared dimension remains available to users while the dimension is incrementally updated, and the added dimension members are available in the cube after the update is complete.

Rebuild the dimension structure

Select this option to completely rebuild the dimension structure. This option is appropriate after you’ve made changes to the structure or relationship of the dimension levels or members. For example, use this option after you add, delete, or move a level or after you move a member from one parent member to another.

Important When a shared dimension is processed with this option, all cubes that incorporate the shared dimension immediately become unavailable to users and must be processed before they can be used again.

Caution If a shared dimension’s structure is updated and saved but not processed, it will automatically be processed when any cube incorporating the dimension is processed. At that time any other cubes that incorporate the dimension immediately become unavailable to users and must be processed before they can be used again.

OK

Starts the type of processing you’ve chosen.

Cancel

Closes the dialog box without processing the dimension.

Help

Displays this topic in Help.


Properties Dialog Box

Enables you to specify options for warnings, file locations, environment, processing, the query log, and add-ins. This dialog box appears when you right-click a server in the OLAP Manager tree view and then click Properties.

Five tabs are present in the Properties dialog box: General, Environment, Processing, Query Log, Add-Ins.

Properties Dialog Box - All Tabs

The following four options are on all tabs.

Reset Defaults

Resets options on all tabs of the Properties dialog box to their default installation values. An exception is that options on the Add-Ins tab are not affected.

OK

Closes the Properties dialog box and makes the changes you specified.

Cancel

Closes the Properties dialog box without making changes.

Help

Displays this topic in Help.


Properties Dialog Box - General Tab

Return to: Properties dialog box

Other tabs: Environment, Processing, Query Log, Add-Ins.

The General tab enables you to specify whether certain warnings are displayed and to change the folders used by Microsoft® SQL Server™ OLAP Services.

Options

Enable dimension level counting

Causes OLAP Services to count the members in a new dimension level when it is added and to display a warning if the level is added below a level with more members.

Although this option provides real-time hierarchical structure validation, counting large numbers of members may take several minutes or longer. Turning off the option speeds up the dimension creation process; however, the hierarchical structure validation of members does not occur.

Default: members are counted automatically, and warnings are displayed.

Note In the Dimension wizard, this option can be temporarily overridden with the Count level members automatically check box. The override is effective only for the duration of the wizard.

To count level members automatically and display warnings

  • Select the Enable dimension level counting check box, and then click OK.

Show process warning

Causes OLAP Services to display the following warning when a new or updated cube is saved without aggregations:

Individual administrators can turn off the option by selecting the Don’t show this message again check box in the Design Storage dialog box. Thereafter, the only way to begin displaying the warnings again is to select the Show process warning check box in the Properties dialog box.

Default: warnings are displayed.

To display warnings when cubes are saved without aggregations

  • Select the Show process warning check box, and then click OK.

Show database password warning

Causes OLAP Services to display a warning when a data source is saved with a password. The following warning is displayed when in the Data Link Properties dialog box, on the Connection tab, an administrator specifies a user name and password, selects the Allow saving of password check box, and then clicks OK.

In the Security Warning dialog box, the administrator can click Cancel to avoid the security exposure.

Individual administrators can turn off the option by selecting the Don’t show this message again check box in the Security Warning dialog box. Thereafter, the only way to begin displaying the warnings again is to select the Show database password warning check box in the Properties dialog box.

Default: warnings are displayed.

To display warnings when data source passwords are saved

  • Select the Show database password warning check box, and then click OK.

Data folder

Determines the data folder used by OLAP Services. If you select a new folder, the temporary file folder (see below) is also changed to that folder.

Caution If you select a new folder, OLAP Services will not access existing data.

Default: ..\Program Files\OLAP Services\Data

To change the data folder used by OLAP Services

  1. Beside the Data folder box, click Browse, select a new folder, and then click OK.
  2. In the Properties dialog box, click OK.

If you change the folder, you must restart the server.

Temporary file folder

Determines the temporary folder used by OLAP Services. If you select a new data folder (see above), the temporary file folder is also changed to that folder.

Default: the folder specified in the Data folder box.

To change the temporary file folder used by OLAP Services

  1. Beside the Temporary file folder box, click Browse, select a new folder, and then click OK.
  2. In the Properties dialog box, click OK.

If you change the folder, you must restart the server.


Properties Dialog Box - Environment Tab

Return to: Properties dialog box

Other tabs: General, Processing, Query Log, Add-Ins.

The Environment tab enables you to change performance and memory settings.

Options

Maximum number of threads

Determines the number of threads that can simultaneously utilize the CPUs in the server computer.

Default: 2 times the number of CPUs in the server computer.

Valid range: 1-1000.

To change the maximum number of threads

  1. In the Maximum number of threads box, specify the maximum number. Only integers are valid.
  2. Click OK.

Large level defined as

Determines the minimum number of members a dimension level must contain to be processed as a “large” level.

Microsoft® SQL Server™ OLAP Services classifies dimension levels into “large” and “small” categories based on the number of level members. These two categories are processed differently. For example, large levels are not sent to the client unless they are specifically requested, but small levels are sent to the client even if the entire level is not requested.

Default: 1,000 members.

Valid range: 1-10,000 members.

To change the definition of large levels

  1. In the Large level defined as box, specify the minimum number of members a dimension level must contain to be processed as a “large” level. Only integers are valid.
  2. Click OK.

Minimum allocated memory

Determines the amount of memory allocated exclusively to OLAP Services. Actual memory usage may exceed this value.

Default: one-half of server computer’s memory.

To change the amount of memory allocated to OLAP Services

  1. In the Minimum allocated memory box, specify the allocated memory in megabytes (MB). Only integers are valid.
  2. Click OK.

Memory conservation threshold

Determines the memory threshold near which memory usage decreases. When the amount of memory used by OLAP Services approaches this threshold, usage decreases as memory management becomes more efficient. Actual memory usage may exceed this value unless the default value is used.

Default: all of server computer’s memory.

To change the threshold for memory usage

  1. In the Memory conservation threshold box, specify the threshold in MB. Only integers are valid.
  2. Click OK.


Properties Dialog Box - Processing Tab

Return to: Properties dialog box

Other tabs: General, Environment, Query Log, Add-Ins.

The Processing tab enables you to change optimization settings.

Options

Read-ahead buffer size

Determines the maximum amount of data placed into memory during each read of the database. Setting this option as high as possible minimizes the number of disk accesses.

Default: 4 megabytes (MB).

To change the read-ahead buffer size

  1. In the Read-ahead buffer size box, specify the buffer size in MB. Only integers are valid.
  2. Click OK.

Process buffer size

Determines how much data is processed in memory before an input/output (I/O) is performed. The larger the value, the fewer I/Os are required.

Default: 4 MB.

To change the process buffer size

  1. In the Process buffer size box, specify the buffer size in MB. Only integers are valid.
  2. Click OK.

OLE DB timeout

Determines the maximum time Microsoft® SQL Server™ OLAP Services waits for a response from a data source before it stops attempting to connect.

This option may be overridden by the timeout defined for the data source. If in the Data Link Properties dialog box, in the Advanced tab, a connect timeout value is specified for the data source, and the value in Connect timeout is shorter than the value in OLE DB timeout, the value in Connect timeout is used. If a value in Connect timeout is not specified, or it is longer than the value in OLE DB timeout, the value in OLE DB timeout is used.

Default: 0 (disabled).

Valid range: 0 (disabled) - 10,000 seconds (approximately 2 hours, 46 minutes).

To enable the OLE DB timeout

  1. Select the OLE DB timeout check box.
  2. In the Seconds box, specify the amount of time that elapses between an attempt to connect and timeout. Only integers are valid.
  3. Click OK.


Properties Dialog Box - Query Log Tab

Return to: Properties dialog box

Other tabs: General, Environment, Processing, Add-Ins.

The Query Log tab enables you to change the settings for the automatic logging of queries performed by Microsoft® SQL Server™ OLAP Services.

The Usage-Based Optimization wizard and Usage Analysis wizard rely on the query log. Options in this tab affect the output of these wizards.

Options

Sample frequency (once per)

Controls the frequency of query logging. By default, every tenth query is logged. You can turn off query logging altogether or change the frequency.

Note Setting this option too low may adversely affect performance.

Default: 10 (1 in 10 queries is logged).

Valid range: 1-10,000.

To enable query logging and specify the frequency

  1. Check Sample frequency (once per).
  2. In the Queries box, specify the interval between each log entry. A value of x results in the logging of every xth query. For example, a value of 20 results in the logging of every 20th query. Only integers are valid.
  3. Click OK.

Clear entire log

Deletes the contents of the query log.

Consider clearing the query log after you run the Usage-Based Optimization wizard consecutively on all cubes on the server.

To clear the query log

  • Click Clear entire log, and then click OK.
See Also

Optimizing Performance Based on Usage in the Administrator’s Guide

Usage-Based Optimization Wizard in the Administrator’s Reference

Analyzing Usage Patterns in the Administrator’s Guide

Usage Analysis Wizard in the Administrator’s Reference


Properties Dialog Box - Add-Ins Tab

Return to: Properties dialog box

Other tabs: General, Environment, Processing, Query Log.

The Add-Ins tab enables you to control which add-in programs are started automatically with the OLAP Manager. Add-in programs are OLAP applications that are compatible with Microsoft® SQL Server™ OLAP Services but may be produced by companies other than Microsoft.

Note Changes on this tab do not take effect until the OLAP Manager is restarted.

The Reset Defaults button does not affect the options on this tab.

Options

Available Add-ins

Displays the installed add-in programs. Checked add-in programs are started automatically when you start the OLAP Manager. They are started in the order displayed.

Priority

Changes the order in which add-in programs are started with the OLAP Manager.

To change the order in which add-in programs are started

  1. Click the add-in program to change, and click one of the Priority buttons repeatedly until you obtain the desired order. Repeat if necessary.
  2. Click OK.

Description

Describes the add-in program selected in the Available Add-ins box.


Register Function Libraries Dialog Box

Enables you to register other products’ function libraries or user-defined function libraries.

User-defined functions enable client applications to extend the Microsoft® SQL Server™ OLAP Services internal function library. The OLAP Services internal functions always take precedence over registered function libraries. A user-defined function can be developed on any tool capable of generating Microsoft ActiveX® libraries.

You can register user-defined function libraries of the following types:

  • Type libraries (*.olb, *.tlb, *.dll)
  • Executable files (*.exe, *.dll)
  • ActiveX controls (*.ocx)

The order of the libraries in the list is important. It defines the precedence of function name resolution in cases of conflicts (two libraries containing the same function name). The first library takes precedence.

OLAP Services automatically registers the Visual Basic for Applications Expression Services function library (VBA332.dll) and the library that supports the Microsoft Excel worksheet functions. However, the Excel library must be installed separately from OLAP Services.

To add a function library

  1. Click Add.
  2. Locate and select the library file you want to add.

The program IDs associated with the function library appear in the list box.

To remove a program in a function library

  • Select the program ID, and then click Remove.

To complete registration

  • When you are satisfied that the correct programs in external function libraries are contained in the list box, click Close.

The program IDs of the libraries now appear in the Functions box of the Calculated Member Builder. You can return to this dialog box and add or remove other libraries.

Note Functions are supported only if they accept as arguments only string or numeric data types, or array or variant data types containing string or numeric values. In addition, functions are supported only if they return only string or numeric data types, or variant data types containing numeric values.

Calling a User-defined Function from Within MDX

After a user-defined function is registered, it is treated as any other OLAP Services internal function. It can be used anywhere in the MDX syntax that allows for expressions. For example:

With Member Measures.[Forecasted Sales] As

     'Sale * ForecastedGrowthRate(SaleReps.CurrentMember.Name)'

Select TopCount(SalesReps, HowManyReps(), Sales) on Rows,

{Sales, [Forecasted Sales] } on Columns

From Sales

The HowManyReps and ForecastedGrowthRate user-defined functions are defined as:

Public Function HowManyReps() as Integer

Public Function ForecastedGrowthRate(RepName as String) as Double

Note There may be multiple user-defined functions residing in the same ActiveX library.


Register OLAP Server Dialog Box

Enables you to register OLAP servers.

This dialog box appears when you right-click the OLAP servers folder in the OLAP Manager tree view and then click Register Server.

Options

Server name

Type the name of the OLAP server you want to connect to.

OK

Registers the server name in the OLAP Manager and returns you to the OLAP Manager tree view.

Cancel

Cancels the registration of your server name and returns you to the OLAP Manager tree view.

Help

Displays this topic in online Help.


Save Object Dialog Box

Enables you to name objects in your OLAP database.

This dialog box appears at various times when you are saving new or edited objects in your OLAP database.

Options

Object name

Type a name for the object. For a dimension name, you can enter a maximum of 24 characters. For other objects’ names, such as a cube name, you can enter a maximum of 50 characters.

OK

Saves the name of the object and closes the dialog box.

Cancel

Cancels the creation of the object name and closes the dialog box.

Help

Displays this topic in online Help.


Select Column Dialog Box

Enables you to select columns in a dimension or measure in the Dimension editor or the Cube editor.

This dialog box appears at various times when you are editing dimensions and measures in both the Cube editor and the Dimension editor.

Options

Tree view

Displays the available columns.

Column types

Select or clear check boxes to display columns of the type described.

OK

Selects the column you choose and returns you to the Cube editor or the Dimension editor.

Cancel

Cancels the selection of a column and returns you to the Cube editor or the Dimension editor.

Help

Displays this topic in online Help.


Select the Parent Member Dialog Box

Enables you to select a different parent member for your calculated member.

This dialog box appears when you click Change in the Calculated Member Builder.

Options

Tree view

Enables you to expand the dimension and select the parent member you want for your calculated member.

OK

Selects the parent member you choose and returns you to the Calculated Member Builder.

Cancel

Cancels the dialog box and returns you to the Calculated Member Builder.

Help

Displays this topic in Help.


Select Table Dialog Box

Enables you to select a table from a selected data source.

This dialog box appears at various times when you are working in the Cube editor or the Dimension editor.

Options

Tables

Displays the tables of the selected data source.

Details

Displays a description of the data source if a data source is selected in the Tables box. Displays the columns in the table if a table is selected in the Tables box.

Add

Selects the table you choose.

Close

Closes the dialog box.

Help

Displays this topic in online Help.


Select Users Dialog Box

This dialog box is displayed from two wizards:

  • Usage-Based Optimization wizard. This dialog box enables you to select user names and groups by whose query usage you want to optimize.
  • Usage Analysis wizard. This dialog box enables you to select user names and groups whose query usage you want to analyze.

The Select Users dialog box appears when in either wizard you select the Queries by these users check box and then click Add.

Groups and users in roles granted permission to the cube are displayed in the Available users box.

To select a group or user

  • Click the group or user in the Available users box, and then click Add.

Options

Add

Adds the selected group or user to the Selected users box.

OK

Returns you to the wizard and places the groups and users you selected in the Queries by these users box.

Cancel

Cancels the selection of new groups and users and returns you to the wizard.

Help

Displays this topic in online Help.


Write Enable Dialog Box

Allows you to enable read/write permissions on a cube.

If you write-enable a cube, users in roles granted read/write permission to the cube can record changes to cube data while they browse the cube. Changes are recorded in a table called a write-back table, separate from the cube data and its source data. Users who browse a write-enabled cube see the net effect of all changes in the write-back table for the cube.

This dialog box appears when you right-click a cube and then click Write-Enable.

Options

Table name

Type a name for the cube’s write-back table.

Data source

Select the data source to store the write-back table.

New

Click this button to specify a new data source.

OK

Saves changes you have made and closes the dialog box.

Cancel

Closes the dialog box without saving changes.

Help

Displays this topic in online Help.


Flexible Data Model

Microsoft® SQL Server™ OLAP Services supports various data and storage models to help you create and maintain an OLAP system that meets your organization’s needs.

Multiple Data Storage Options

OLAP Services offers three storage modes for your system:

  • MOLAP (multidimensional OLAP)

    The underlying data for a cube is stored along with aggregation data in a high-performance multidimensional structure. MOLAP storage provides excellent performance and data compression.

  • ROLAP (relational OLAP)

    The underlying data for a cube is stored along with the aggregation data in a relational database. ROLAP storage enables you to take advantage of your investment in relational technology and enterprise data management tools.

  • HOLAP (hybrid OLAP)

    The underlying data for a cube is stored in a relational database and the aggregation data is stored in a high-performance multidimensional structure. HOLAP storage offers the benefits of MOLAP for aggregations without necessitating duplication of the underlying detail data.

Virtual cubes and partitions are other forms of hybrid OLAP that enable you to tailor cube storage alternatives to meet your needs.

Partitioned Cube Storage

You can partition a cube into separate physical sections. You can store each partition in a different mode, in a different physical location, and with a level of aggregations appropriate to the data in the partition. The result is that you can fine tune the performance and data management characteristics of your system.

Note User-defined partitions are available only if you install Microsoft SQL Server OLAP Services, Enterprise Edition.

Partition Merging

You can combine a cube’s multiple partitions back into a single physical partition. For example, you can use partition merging to consolidate portions of cube data such as data for a just completed quarter into a single partition for the year.

Note User-defined partitions are available only if you install Microsoft SQL Server OLAP Services, Enterprise Edition.

Writable Cubes

You can enable a cube for write access by multiple simultaneous users. User-initiated changes to the cube data are logged to a special, physically separated partition table associated with the cube and applied automatically as cube data is viewed. To the user it appears as if the data in the cube has changed. The changes can be discarded or made read-only at the discretion of the database administrator (DBA).

Virtual Cubes

You can join cubes into virtual cubes, much like tables can be joined with views in a relational database. A virtual cube provides access to data in the combined cubes without necessitating the construction of a new cube, while it allows you to maintain the best design for each individual cube.

Calculated Members

You can create calculated measures and calculated dimension members by combining multidimensional expressions (MDX), mathematical formulas, and user-defined functions (UDFs). This facility enables you to define new measures and dimension members based upon a rich yet easy-to-use expression syntax. You can register additional libraries of UDFs to use in calculated member definitions.

Member Properties

You can define properties for dimension members and use data for these properties within a cube. For example, if the members of a Product dimension are SKUs, there are likely to be several properties associated with SKUs such as size, color, fabric, and so forth. You can specify such properties as member properties and use them in analytical queries.

Virtual Dimensions

Virtual dimensions can be created from member properties associated with shared dimensions. A virtual dimension can be used to evaluate the properties of a dimension’s members against the members themselves. For example, measures can be evaluated for SKUs against size, color, fabric, and so forth. Virtual dimensions and member properties are evaluated as necessary for queries and require no physical cube storage.


Scalability

OLAP Services provides a scalable OLAP architecture to address a variety of data warehousing scenarios.

Customized Aggregation Options

Using the Storage Design wizard, you can optimize the trade-off between system performance and disk space allocated to storing aggregations. Microsoft® SQL Server™ OLAP Services uses a sophisticated algorithm to determine the optimum set of aggregations from which other aggregations can be derived. As a result, you can focus on application design issues and leave the complex management of aggregation design up to the system.

Usage-Based Optimization

You can tune the performance of a cube to provide quick response to the queries most often executed by directing the Usage-Based Optimization wizard to design aggregations appropriate to those queries while maintaining reasonable storage requirements. Thus, you can quickly build a system with a minimum number of aggregations, and then later optimize performance according to the actual usage of the system.

Data Compression and Storage Optimization

In MOLAP and HOLAP storage modes, OLAP Services stores all or some of the cube information in multidimensional structures. In these structures, storage is not used for empty cells, and a sophisticated data compression algorithm is applied to data that is stored. When combined with the flexible options for the design and optimization of precalculated aggregations, these techniques help to minimize the impact of the “data explosion syndrome” inherent in OLAP technology.

Distributed Calculation

PivotTable® Service incorporates functionality from the server so that calculations can often be performed on the client instead of the server. This spreads the computational load between the server and the client, thus increasing the capacity of the server, reducing network traffic, and improving performance for the clients.

Partitions

You can spread a cube over multiple servers by dividing it into partitions. OLAP Services can then retrieve data in parallel to answer queries. Partitioning enables you to manage your storage strategy, increase scale with multiple servers, and increase performance.

Note User-defined partitions are available only if you install Microsoft SQL Server OLAP Services, Enterprise Edition.

Incremental Updates

A cube can be updated by processing only data that has been added rather than the entire cube; you can use incremental update to update OLAP cubes while they are in use.

LAN, WAN, Internet, and Mobile Scenarios

Intelligent cache management integrates the OLAP server with the PivotTable Service client, minimizing traffic over LAN and WAN connections. PivotTable Service contains an efficient multidimensional calculation engine to further minimize network traffic and to enable analysis of local multidimensional data when the client is not connected to the server.

Microsoft ActiveX® controls, Active Server Page (ASP) scripting, and ActiveX Data Objects (ADO) APIs provide a variety of solutions for querying OLAP data over the Web.

Support for Windows NT on the DEC Alpha Platform

In addition to the Intel® platform, all of the client and server technologies of OLAP Services are supported on Microsoft Windows NT® for the DEC Alpha platform.

Client Support for Windows 95 and Windows 98

PivotTable Service runs on Microsoft Windows® 95 and Windows 98, supporting client applications available for these platforms as well as for Windows NT.


Data Warehousing and OLAP

Although frequently used interchangeably, the terms “data warehousing” and “online analytical processing (OLAP)” apply to different components of systems often referred to as “decision support systems” or “business intelligence systems.” Components of these types of systems include databases and applications that provide the tools analysts need to support organizational decision making.

A data warehouse is a database containing data that usually represents the business history of an organization. This historical data is used for analysis that supports business decisions at many levels, from strategic planning to performance evaluation of a discrete organizational unit. Data in a data warehouse is organized to support analysis rather than to process real-time transactions as in online transaction processing systems (OLTP).

OLAP technology enables data warehouses to be used effectively for online analysis, providing rapid responses to iterative complex analytical queries. OLAP’s multidimensional data model and data aggregation techniques organize and summarize large amounts of data so it can be evaluated quickly using online analysis and graphical tools. The answer to a query into historical data often leads to subsequent queries as the analyst searches for answers or explores possibilities. OLAP systems provide the speed and flexibility to support the analyst in real time.


Advanced Topics

Microsoft® SQL Server™ OLAP Services provides powerful features for managing OLAP data. Advanced features can help you provide more effective OLAP support.

This section contains information on the following advanced features:

  • Calculated Members
  • Virtual Cubes
  • Member Properties
  • Virtual Dimensions
  • Write-Enabled Cubes
  • Partitions


Calculated Members

A calculated member is a dimension member whose value is calculated at run time using an expression that you specify when you define the calculated member. Calculated members can also be defined as measures. Only the definitions for calculated members are stored; values are calculated in memory when needed to answer a query.

Calculated members enable you to add members and measures to a cube without increasing its size. Although calculated members must be based on a cube’s existing data (such as members), you can create complex expressions by combining this data with arithmetic operators, numbers, and a variety of functions. Microsoft® SQL Server™ OLAP Services not only includes a library of over 100 functions but also allows you to register and use other function libraries.

For example, suppose executives in a shipping company want to determine which types of cargo are more profitable to carry, based on profit per unit of volume. They use a Shipments cube containing the dimensions Cargo, Fleet, and Time and the measures Price_to_Ship, Cost_to_Ship, and Volume_in_Cubic_Meters; however, the cube does not contain a measure for profitability. You can create a calculated member as a measure named Profit_per_Cubic_Meter in the cube using the existing measures in the expression:

([Measures].[Price_to_Ship] - [Measures].[Cost_to_Ship]) / [Measures].[Volume_in_Cubic_Meters]

The next time the Shipments cube is browsed, Profit_per_Cubic_Meter appears along with the other measures.

For more information, see Creating Calculated Members and Calculated Member Builder.


Virtual Cubes

A virtual cube is a combination of multiple cubes in one logical cube, somewhat like a relational database view that combines other views and tables. When you create a virtual cube, you select measures and dimensions from the consolidated set of dimensions and measures in the underlying component cubes. End users see the virtual cube as a single cube.

A virtual cube can also be based on a single cube to expose only selected subsets of its measures and dimensions.

Because virtual cubes store only their definitions and not the data of their component cubes, they require virtually no physical storage space. You can use virtual cubes to create combinations and variants of existing cubes without using significant additional storage.

A virtual cube can provide a valuable security function by limiting some users’ view of the underlying cubes. If some of a cube’s information is sensitive and not suitable for all users, create a virtual cube from the cube and omit the sensitive information. Then create two security roles: the first containing the users permitted to see the sensitive information, and the second containing the other users. Finally, grant the first role access to the cube and the second role access to the virtual cube.

After you create a virtual cube, you must process it before client applications can browse it. Processing a virtual cube establishes the internal links to the specified dimensions and measures in its underlying cube or cubes. This linking operation is performed quickly. However, processing a virtual cube automatically triggers processing of all underlying cubes that need to be processed, which can add significant time.

For more information, see Building a Virtual Cube.


Member Properties

A member property is an attribute of a dimension member. It provides cube users with additional information about the member. For more information about dimension members, see Defining Dimensions.

In some browsers, member properties can be easily viewed. The method of displaying member properties varies from browser to browser; for example, an end user might right-click a member to view its member properties. This type of presentation makes available useful information about members without cluttering the default view.

Member properties have a variety of uses. In addition to providing information about a member, member properties can be used in queries and thus provide end users with more options when analyzing cube data. Member properties are also the basis of virtual dimensions. For more information, see Virtual Dimensions.

Values for member properties must be read from a column in the same dimension table as the associated members. You create a member property in the Dimension editor by associating the column that contains values for the member property with the level that contains the members. For example, to create the member property Store Type for members of the Store Name level, ensure that the Store Type column is in the same table as the Store Name column, and then insert Store Type as a member property in the Store Name level.

For more information, see Creating Member Properties.


Virtual Dimensions

A virtual dimension is a logical dimension based on a property of a level in a physical dimension. This property is called a “member property” and must be created before the virtual dimension. For more information, see Member Properties.

Virtual dimensions enable end users to analyze cube data based on the member properties of dimension level members in a cube. For example, suppose the Store Name level of the Store dimension has a member property Store Sqft that identifies the area of the store in square feet. You can then create a virtual dimension named Store Size in SqFt using the Store Sqft member property. This virtual dimension can be added to any cube that also contains the Store dimension. End users can use this virtual dimension just like any other dimension.

Note You can add a virtual dimension to a cube only if the dimension that supplies its member property is also included in the cube.

Adding a virtual dimension to a cube does not increase the cube’s size because, unlike an ordinary dimension, a virtual dimension’s aggregation data is not stored in the cube. Virtual dimensions do not affect cube processing time because they are calculated in memory when needed. Queries that use virtual dimensions, however, can be significantly slower than queries that use ordinary dimensions.

Microsoft® SQL Server™ OLAP Services provides the Virtual Dimension wizard for easy creation of virtual dimensions.

For more information about virtual dimensions, see Creating Virtual Dimensions.


Write-Enabled Cubes

If you specify a cube as write-enabled, client applications can record changes to the cube’s data. These changes are called “write-back” data and are stored in a table separate from the cube and its underlying data, but are incorporated into query results as if they were part of the cube data. Write-enabled cubes allow end users to explore scenarios by changing cell values and analyzing the effects of the changes on cube data.

An end user’s change is stored in the write-back table as a difference from the currently displayed value. For example, if an end user changes a cell value from 90 to 100, the value +10 is stored in the write-back table, along with the time of the change and information about the end user who made it. The net effect of accumulated changes is displayed to client applications. The original value in the cube is preserved and an audit trail of changes is recorded in the write-back table.

Changes can only be made to cells at the lowest level, that is, cells that do not contain aggregated information. For example, an end user can change the value of an individual sale, but not the total sales for a store, quarter, or other summarized value. Changes are applied to summarized values when queries are evaluated so end users can view the effects of the change throughout the cube.

End user changes are kept in a separate write-back table that you can:

  • Convert to a partition to permanently incorporate changes into the cube and make the cube read-only. You can specify a filter expression to select the changes you want to convert.

    Note Converting to a partition is available only if you install Microsoft® SQL Server™ OLAP Services, Enterprise Edition.

  • Discard to return the cube to its original state.

For more information about write-enabling a cube, browsing write-back data, and converting write-back tables to partitions, see Maintaining Write-Enabled Cubes and Write-Back Data and its subtopics.

An end user is permitted to record changes in a cube’s write-back table only if the user belongs to a role with read/write permissions assigned to the cube. For more information, see Creating Security Roles.


Partitions

Every cube has at least one partition to contain the cube’s data; a single partition is automatically created when the cube is defined. When you create a new partition for a cube, the new partition is added to the set of partitions that already exist for the cube. The cube reflects the combined data contained in all of its partitions. A cube’s partitions are invisible to users of the cube.

Partitions represent a powerful and flexible tool for managing OLAP cubes, especially large cubes. For example, a cube containing sales information can contain one or more partitions for prior years’ data and partitions for each quarter of the current year. At the end of the year the four quarterly partitions can be merged into a single partition for the year. Partitions can be stored using various combinations of options for storage mode, source data location, and aggregation design. This flexibility enables you to design cube storage strategies appropriate to your needs.

Note User-defined partitions are available only if you install Microsoft® SQL Server™ OLAP Services, Enterprise Edition.

Partitions must be created and managed correctly to avoid inconsistent or inaccurate results. The integrity of a cube’s data relies on the data being distributed among the cube’s partitions such that no data is duplicated among the partitions. When data is summarized from the partitions, any data elements that are present in more than one partition will be summarized as if they were different data elements; this can produce incorrect summaries and erroneous data provided to the user. For example, if a sales transaction for Product X is duplicated in the fact tables for two partitions, summaries of Product X sales can include a double accounting of the duplicated transaction.

Partitions can be merged; you can use this feature in your overall storage and data update strategy. Partitions can be merged only if they have the same storage mode and aggregations. To create partitions that will be candidates for later merging, you can select the storage mode and copy aggregations from another partition when you create the partition. You can also edit a partition after it has been created and copy aggregations from another partition. Merging partitions must also be performed carefully to avoid duplication of data in the combined partition, which can cause cube data to be inaccurate.

When you are creating or merging partitions, you may need to perform manual operations or create appropriate filters to ensure that a cube’s partitions always contain the correct data. This section addresses issues and precautions to be aware of when you are:

  • Creating Partitions.
  • Merging Partitions.


Creating Partitions

Note User-defined partitions are available only if you install Microsoft® SQL Server™ OLAP Services, Enterprise Edition.

You can specify the portion of a cube’s data allocated to a partition in three ways:

  • Specify a data slice in the Partition wizard
  • Use a different fact table for the partition
  • Filter data in a fact table used by multiple partitions

Regardless of the method you use to specify the data for a partition, it is your responsibility to ensure that data is not duplicated among partitions.


Merging Partitions

Merging partitions is a powerful tool, but care must be taken to fully understand the process and how to ensure the merge operation produces your intended results.

There are restrictions on merging partitions that must be taken into account when the partitions are created to ensure they can be merged at a later time. In addition to the restriction that partitions must have the same structure, partitions can be merged only if they:

  • Are stored in the same mode (MOLAP, HOLAP, or ROLAP), and
  • Contain identical aggregation designs.

To create a partition that is a candidate for future merging, you can choose to copy the aggregation design from another of the cube’s partitions when creating the partition in the Partition wizard. This will ensure that these partitions have the same aggregation design; when they are merged, the aggregations of the source partition are combined with the aggregations in the target partition.


Fact Table Considerations when Merging Partitions

Important Fact tables are not merged automatically when you merge partitions. You must manually merge fact tables when the partitions being merged have different fact tables.

When you merge partitions, the filters of both partitions are ORed together to create a filter for the resulting partition. This combined filter specifies the set of facts used in the resulting partition. If the source and target partitions use the same fact table, the combined filter specifies the data in the fact table appropriate to the partition. Because the facts necessary for the combined partition are present in the fact table, no further action is necessary.

When you merge partitions that use different fact tables, the resulting partition will refer only to the target partition’s fact table. You must manually merge the facts from the source partition’s fact table that are used by the source partition into the target partition’s fact table. If this manual step is not performed, the partition will not contain complete information.

Caution A merged MOLAP (multidimensional OLAP) partition with an incomplete fact table contains an internally merged copy of fact table data and will operate correctly until it is processed.

When MOLAP partitions are merged, the facts stored in the multidimensional structures of the partitions are also merged. This results in an internally complete and consistent partition. However, the facts stored in MOLAP partitions are copies of facts in the fact table. When the partition is subsequently processed, the facts in the multidimensional structure are deleted and data is copied from the fact table as specified by the partition’s filter. If the source partition uses a different fact table from the target partition, the source partition’s fact table must be manually merged with the target partition’s fact table to ensure that a complete set of data is available when the resultant partition is processed.

Caution A merged HOLAP (hybrid OLAP) or ROLAP (relational OLAP) partition with an incomplete fact table contains accurate aggregations, but incomplete facts. Queries that refer to missing facts will return incorrect data. When the partition is processed, aggregations will be computed only from available facts.

When HOLAP or ROLAP partitions that have different fact tables are merged, the fact tables are not automatically merged. Unless the fact tables are manually merged, only the fact table associated with the target partition is available to the merged partition. Facts associated with the source partition are not available for drilldown in the merged partition, and when the partition is processed, aggregations will not summarize data from the unavailable table.

The absence of unavailable facts might not be noticed unless a user attempts to drill down to a fact in the unavailable table or executes a query that requires a fact from the unavailable table. Because aggregations are combined during the merge process, queries whose results are based only on aggregations will return accurate data, whereas other queries may return inaccurate data. Even after the merged partition is processed, the missing data from the unavailable fact table may not be noticed, especially if it represents only a small portion of the merged data.

Fact tables can be merged before or after merging the partitions. However, the aggregations will not accurately represent the underlying facts until both operations have been completed. It is recommended that merging HOLAP or ROLAP partitions that access different fact tables be accomplished when users are not connected to the cube containing these partitions.


Adding a Multiple-Column Measure to a Cube

A measure can contain multiple columns combined in an expression. For example, the Profit measure is the difference of two numeric columns: Sales and Cost.

When you build or update a cube in the Cube editor, you can add such a measure.

Caution If the cube contains multiple partitions, this procedure will delete them and add a single default partition.

To add a multiple-column measure to a cube

  1. In the OLAP Manager tree view, right click the cube, and then click Edit.
  2. In the Cube editor tree view, right-click the Measures folder, and then click New Measure. Use the Select Column dialog box to select one of the columns for the measure.
  3. In the Cube editor tree view, ensure the new measure is selected.
  4. Expand the Properties pane, and in the Source Column value, type an expression containing the columns. For example:

    "sales_fact_1998"."store_sales"-"sales_fact_1998"."store_cost"

  5. Save the cube.

After adding the measure, you will need to redesign storage options and aggregations for the cube using the Storage Design wizard.

You must also process the cube before users can view its data. Depending on the size of the cube, processing may take considerable time. For more information, see Processing Cubes Using the OLAP Manager.


Building a Virtual Cube

To quickly and easily build a virtual cube, use the Virtual Cube wizard. The wizard takes you through steps to specify your virtual cube’s:

  • Cubes.

    Select the cubes that contain the data you want in your virtual cube. A cube is a set of data organized and summarized into a multidimensional structure defined by measures and dimensions. The virtual cube creates a combined view of your selected cubes by including their measures and dimensions that you select.

  • Measures.

    Select the measures to be available to users of your virtual cube. A measure contains numerical data (for example, Sales) viewed and analyzed by users. Each measure corresponds to a column in the fact table in a selected cube. This column supplies the measure’s values.

  • Dimensions.

    Select the dimensions to be available to users of your virtual cube. Dimensions are descriptive categories by which the measures can be separated for analysis. In tabular browsers, they provide the column headings, row headings, and subheadings by which the measures are separated and displayed to cube users. (In graphical browsers, they provide other types of descriptive labels but with the same function as in tabular browsers.) For example, the measure is Sales, and the dimensions are Time, Location, and Product. Users can separate Sales into various categories of Time, Location, and Product. Time provides headings for individual years and subheadings for months. Location and Product also supply a variety of headings and subheadings.

    Each dimension is created from one or more columns in a dimension table. These columns supply the dimension’s values which produce the column headings, row headings, and subheadings seen by virtual cube users.

For more information about virtual cubes, see Virtual Cubes.

To start the Virtual Cube wizard

  1. In the OLAP Manager tree view, expand a database.
  2. Right-click the Virtual Cubes folder, and then click New Virtual Cube.

The last step of the wizard gives you the option to process your virtual cube now or later. You must process it before you and users can view its data. Depending on the size of the unprocessed cubes in your virtual cube, processing may take considerable time. If all the cubes in your virtual cube have been processed, virtual cube processing is much faster. If you decide to process later, refer to Processing Cubes Using the OLAP Manager for more information.

Note Newly processed virtual cubes are visible to client users only after they reconnect to the server computer.

After you make nonstructural changes to a cube, you must process dependent virtual cubes to provide users continuing access to them. (This processing is much faster than processing the component cubes if the component cubes’ structures have not changed since their last processing.) These changes include adding or changing a calculated member, changing security roles, and changing the Description property value. When you make a nonstructural change, virtual cube users connected to the server computer are unaffected as long as they remain connected. However, until you process the dependant virtual cubes, users who connect will be unable to see them.


Creating Calculated Members

You can create customized measures or dimension level members, called calculated members, by combining cube data, arithmetic operators, numbers, and/or functions. For example, you can create a calculated member called “Marks” that converts dollars to marks by multiplying an existing dollar measure by a conversion rate. Marks can then be displayed to cube users in a separate row or column.

Calculated member definitions are stored, but their values exist only in memory. So, in the preceding example, values in marks are displayed to cube users but not stored as cube data.

Microsoft® SQL Server™ OLAP Services provides its own extensive function library for creating calculated members. It also supports other function libraries:

  • Microsoft Visual Basic® for Applications Expression Services: This library is included with OLAP Services and automatically registered.
  • Microsoft Excel worksheet: This library must be installed separately from OLAP Services, but it is automatically registered.
  • Others: These libraries must be installed separately from OLAP Services and manually registered by clicking Register in the Calculated Member Builder.

OLAP Services supports only some functions in libraries other than the OLAP Services function library. Functions are supported only if they accept as arguments only string or numeric data types, or array or variant data types containing string or numeric values. In addition, functions are supported only if they return only string or numeric data types, or variant data types containing numeric values. It is recommended that you test separately each function from these libraries before you expose the resulting data to users. For lists of supported functions, see Visual Basic for Applications Functions and Excel Functions.

Note When you use a function in a library other than the OLAP Services function library, you can omit an optional argument only if you also omit all arguments that follow it.

If multiple libraries include the same function name, OLAP Services functions take precedence. After that, precedence is resolved in order of registration.

In order for client users to see the correct values returned by a function, the library containing the function must be installed and registered on their computers.

To create a calculated member, use the Calculated Member Builder. It enables you to specify the following definitions for the calculated member:

  • Parent dimension

    Select the parent dimension to include the calculated member. Dimensions are descriptive categories by which the numeric data (that is, measures) in a cube can be separated for analysis. In tabular browsers, dimensions provide the column and row headings displayed to users when they browse a cube’s data. (In graphical browsers, they provide other types of descriptive labels but with the same function as in tabular browsers.) A calculated member provides a new heading (or label) in the parent dimension you select.

    Alternatively, you can include the calculated member in the measures instead of a dimension. This option also provides a new column or row heading, but it is attached to measures in the browser.

  • Parent member

    Select a parent member to include the calculated member. This option is unavailable if you select a one-level dimension or Measures as the parent “dimension.”

    Dimensions are divided into levels which contain members. Each member produces a heading. While browsing the cube’s data, users can drill down from a selected heading to subordinate headings previously undisplayed. The heading for the calculated member is added at the level directly below the parent member you select.

  • Name

    Select the name of the calculated member. This name appears as the column or row heading for the calculated member values when users browse the cube.

  • Value expression

    Specify the expression that produces the values of the calculated member. The expression may contain any of the following:

    • Data:

      – Cube name

      – Measures category

      – Measures level category

      – Measure name

      – Dimension name

      – Level name

      – Member name

      – Calculated member name

    • Arithmetic operators
    • Numbers
    • Functions:

      OLAP Services functions are divided into the following categories:

      – Array

      – Dimension

      – Hierarchy

      – Level

      – Logical

      – Member

      – Numeric

      – Set

      – String

      – Tuple

The Calculated Member Builder has extensive Help.

For more information, see Calculated Members.

To create a calculated member using the Calculated Member Builder

  1. In the OLAP Manager tree view, under a database, expand the Cubes folder.
  2. Right-click the cube to contain the calculated member, and then click Edit.
  3. In the Cube editor, on the Insert menu, click Calculated Member.
  4. In the Calculated Member Builder:
    1. In the Parent dimension box, select the dimension that will include the calculated member, or select Measures.
    2. In the Parent member box, specify the member that will include the calculated member. Click Change to select a member other than the displayed member. (Change is unavailable if you selected a one-level dimension or Measures in Step A.)
    3. In the Member name box, type a name of the calculated member.
    4. In the Value expression box, construct an expression to produce the values of the calculated member. Use any combination of the following methods to add to the expression:
    • Drag items from the Data and Functions boxes.
    • Click an item in the Data or Functions box, and then click Insert.
    • Click the arithmetic operator and number buttons.
    • Type. This method is required to add functions from libraries other than the OLAP Services function library.
    5. To register additional function libraries, click Register.
    6. To close the Calculated Member Builder, click OK.
  5. To save the calculated member, in the Cube editor, on the File menu, click Save.

Note Calculated members are not visible in the OLAP Manager tree view. To create and access them, you must first display the Cube editor.

After you add or change a calculated member in a cube, you must process dependent virtual cubes to provide users continuing access to them. (This processing is much faster than processing the component cubes if the component cubes’ structures have not changed since their last processing.) When you add or change the calculated member, virtual cube users connected to the server computer are unaffected as long as they remain connected. However, until you process the dependent virtual cubes, users who connect will be unable to see them.

You can rename a calculated member. Renaming changes the associated column or row heading displayed to cube users.

To rename a calculated member

  1. In the OLAP Manager tree view, under a database, expand the Cubes folder.
  2. Right-click the cube containing the calculated member, and then click Edit.
  3. In the Cube editor tree view, right-click the calculated member, and then click Rename.
  4. In the box beside the calculated member icon, type a new name, and then click outside the box.


Updating OLAP Data

OLAP data must be updated after data warehouse data is changed. You process OLAP cubes, dimensions, and partitions to incorporate new or changed data from the data warehouse. The method of processing an OLAP object depends on the object and type of change made to the data warehouse, such as data addition, data change, or structural change. You can use the incremental update, refresh data, or process methods to update cube data. Dimensions can be updated with the incremental update or rebuild the dimension structure methods. Partitions can only be updated with the process method.

For more information, see Processing Cubes and Processing Dimensions.


Measures

Measures are the numeric data of primary interest to cube users. The measures you select depend on the types of information requested by users. Some common measures are sales, cost, expenditures, and production count.

Measures are aggregated by Microsoft® SQL Server™ OLAP Services, and the aggregations are stored for quick retrieval by users querying cubes. You select the measures for a cube when you build it with the Cube wizard or the Cube editor. You also select measures when you build a virtual cube with the Virtual Cube wizard.

Each measure is stored in a column in a fact table in the data warehouse. Because a cube can have only one fact table, all of a cube’s measures must be contained within it.

A measure can contain multiple columns combined in an expression. For example, the Profit measure is the difference of two numeric columns: Sales and Cost. For information about adding this type of measure to a cube, see Adding a Multiple-Column Measure to a Cube.

Fact table columns can be additive or nonadditive, and OLAP Services can use both types as measures. Additive columns can be summed. For example, a monetary column is additive. Additive columns are suitable as measures in a cube. Nonadditive columns cannot be summed meaningfully. For example, a numeric column containing an identifier such as Account Number is nonadditive. Nonadditive columns themselves are not suitable as measures in a cube, but they can be combined with some functions such as Count. The result can then be used as a measure. To apply a function to a nonadditive column so that the result can be used as a measure, create a calculated member.

Calculated members can be used as measures. Calculated member values are created from formulae when the cube is browsed, but the values are not stored. Thus, calculated members save storage. For more information, see Calculated Members.

Users’ Views of Measures

Measures form the core of cube information presented to users. Presentation may be tabular or graphical depending on the tool with which users browse cubes, but the measures are the information users focus on.

In tabular presentations, measures are displayed in rows and columns. Whereas a cube’s dimensions determine the column and row headings, the measures are the data in the rows and columns. However, if you specify multiple measures in a cube, they too provide headings to separate the measures.

In graphical presentations, measures may be displayed in a variety of ways including lines, shapes, colors, shades, and shadows. Nevertheless, as in tabular presentations, the measures occupy the focal portion of the presentation while the dimensions provide peripheral labels.


Cubes

The following topics introduce you to:

  • Defining cubes.
  • Aggregations and data storage modes (MOLAP, ROLAP, and HOLAP).
  • Processing, incrementally updating, and refreshing cubes.


Processing Cubes

When you process a cube, the aggregations designed for the cube are calculated and the cube is loaded with the calculated aggregations and data. Processing a cube involves reading the dimension tables to populate the levels with members from the actual data, reading the fact table, calculating specified aggregations, and storing the results in the cube. After a cube has been processed, it is available for querying by users.

Each of the following three processing options is appropriate in different circumstances:

  • Process
  • Incremental update
  • Refresh data


Processing a Cube

Process is the term used for a complete load of the cube. All dimension and fact table data is read and all specified aggregations are calculated. You must process a cube when its structure is new or its dimensions or measures have been edited. Processing a cube can take a substantial amount of time if there is a large fact table and there are many dimensions with many levels and many items in each level. The loading of dimension information is not required if you use preprocessed shared dimensions in cubes.

Changes in the data warehouse schema that affect the structure of cubes require those cubes to have their structure changed and then be processed. Changes in or additions to data in the data warehouse do not require cubes to be completely processed. Such changes can be incorporated into existing cubes using the incremental update or refresh data processing options, depending on how the data changed.


Incrementally Updating a Cube

An incremental update is appropriate when new data is to be added to a cube, but existing data has not changed and the cube structure remains the same. The incremental update option adds new data and updates aggregations; it does not require that the cube be processed.

An incremental update does not affect the existing data that has already been processed. It usually requires significantly less time than processing. An incremental update can be performed while users continue to query the cube; after the update is complete, users have access to the additional data without having to disconnect and reconnect.


Refreshing a Cube's Data

Refreshing a Cube’s Data

The refresh data option causes a cube’s data to be cleared and reloaded and its aggregations recalculated. This option is appropriate when the underlying data in the data warehouse has changed but the cube’s structure remains the same. This option is faster than processing the cube because aggregation tables do not have to be redesigned.

The refresh data option can be performed while users continue to query the cube; after the refresh has completed users will have access to the updated data without having to disconnect and reconnect.


Dimensions

Dimensions are descriptive categories by which the numeric data (that is, measures) in a cube are separated for analysis. For example, if a cube’s measure is Production Count, and its dimensions are Time, Factory Location, and Product, users of the cube can separate Production Count into various categories of Time, Factory Location, and Product.

A dimension can be created for use in an individual cube or multiple cubes. A dimension created for an individual cube is called a private dimension. In the OLAP Manager tree view, private dimensions are found in the Dimensions folder under the cube for which they were created. A dimension that can be used by multiple cubes is called a shared dimension. They are stored in the Shared Dimensions folder in the Library folder for a database. Shared dimensions also appear in the Dimensions folders under the cubes that include them.

Shared dimensions can be used within any cube in the database. By creating shared dimensions and using them in multiple cubes, you avoid the time-consuming alternative of creating duplicate private dimensions within each of the cubes.

Shared dimensions also enable the standardization of business metrics among cubes. For example, standardized shared dimensions for time and geographical location ensure that data analyzed from different cubes will be similarly organized.

You can also create another type of dimension known as a virtual dimension. For more information, see Virtual Dimensions.


Defining Dimensions

When you define a dimension, select one or more columns from a dimension table. If you select multiple columns, all should be interrelated such that their values can be organized into a single hierarchy. To define the hierarchy, sort the columns from most general to most specific. For example, a Time dimension is created from the columns Year, Quarter, Month, and Day.

Each column in a dimension contributes a level to the dimension. Levels are ordered by specificity and organized in a hierarchy that allows logical avenues for drill down. For example, the Time dimension described above enables cube users to drill down from Year to Quarter, Quarter to Month, and Month to Day. Each drill-down provides greater specificity.

Each level contains members. Members are the values within the column that defines the level. For example, the Quarter level might contain four members: First Quarter, Second Quarter, Third Quarter, and Fourth Quarter. However, if data in the table spans more than one year, the Quarter level contains more than four members. For example, if the Year level contains three different values, 1996, 1997, and 1998, the Quarter level contains 12 members.

In tabular browsers, members provide the column headings, row headings, and subheadings by which measures are separated and displayed to cube users. (In graphical browsers, they provide other types of descriptive labels but serve the same function as in tabular browsers.) For example, in the Time dimension described above, measures are separated under three headings: 1996, 1997, and 1998. If the user drills down beneath the Year level, the members of the Quarter level are displayed as subheadings, and the measures are separated further by quarter. If the user drills down beneath the Quarter level, the members of the Month level are displayed as subheadings beneath the Quarter level headings, and the measures are separated further by month.

Each dimension table’s primary key must join to a foreign key in a cube’s fact table or another dimension table. Key columns are not required in the dimension definition.

The Dimension wizard enables you to create dimensions quickly and easily. You can use it separately to create shared dimensions, or you can invoke it while you are creating a cube with the Cube wizard to create private or shared dimensions.

Time dimensions based on datetime columns in the data warehouse are especially easy to construct with the wizard. Standard time hierarchies are available, and the levels associated with a selected hierarchy are automatically extracted from the datetime column.

Microsoft® SQL Server™ OLAP Services also supports multiple-hierarchy dimensions. These dimensions provide similar yet alternate views of cube data. For example, a multiple-hierarchy dimension for time consists of a regular calendar view and a fiscal calendar view. In OLAP Services, a multiple-hierarchy dimension is defined as two or more dimensions with names that share the same prefix followed by a period but have different suffixes (for example, dimensions with names of Time.Calendar and Time.Fiscal). The suffix should not equal any current or future level name or member name in the dimension because queries using the dimension may be ambiguous.

See Also

Creating Shared Dimensions


Processing Dimensions

Two methods are available for processing dimensions: rebuilding a dimension’s structure and incrementally updating a dimension. These methods are used within the Process a Dimension dialog box, which is displayed when you right-click a shared dimension in the OLAP Manager tree view and then click Process.

Rebuilding a Dimension’s Structure

The rebuild the dimension structure option re-creates and loads the dimension. This processing option is required after:

  • The structure of the dimension is changed. For example, you add or remove a level in the hierarchy.
  • Relationships between members in the dimension hierarchy are changed. For example, you redefine sales regions so that cities are now in different regions.

Important When a shared dimension is processed with the rebuild the dimension structure option, all cubes that incorporate the shared dimension immediately become unavailable to users and must be processed before they can be used again.

Caution If a shared dimension’s structure is edited and saved but not processed, it will automatically be processed when any cube incorporating the dimension is processed. At that time any other cubes that incorporate the dimension immediately become unavailable to users and must be processed before they can be used again.

Incrementally Updating a Dimension

The incremental update processing option updates a dimension when new members have been added but no structural changes have been made. For example, you add new customer records to the customer dimension table. A cube that incorporates a shared dimension remains available to users while the dimension is incrementally updated, and the added dimension members are available in the cube after the update is complete.

See Also

Creating Shared Dimensions


Storing Cubes and Aggregations

Cube data and aggregations can be stored in a variety of modes. Aggregations are precalculated summaries of data that provide the mechanism for rapid query response in OLAP systems.

Cubes can require substantial storage to contain the data and precalculated summary information in multidimensional structures. One factor that affects storage requirements is sparsity (the amount of empty cells in a cube). For example, if one dimension contains sales representatives and another dimension contains regions, cells at the intersection of the Northeast sales representative and the Southwest region would probably be empty.

Microsoft® SQL Server™ OLAP Services addresses cube storage requirements with a variety of techniques:

  • Storage is not allocated for empty cells.
  • Data compression is employed.
  • A sophisticated algorithm designs efficient summary aggregations to minimize storage without sacrificing speed.

Storage options enable you to select appropriate storage modes and locations for cube data. You can create an OLAP storage strategy tailored to your needs.

In this section you can read about:

  • Storage Modes (MOLAP, ROLAP, HOLAP)
  • Aggregations


Storage Modes (MOLAP, ROLAP, HOLAP)

Physical storage options affect the performance and storage requirements for cubes. You can store a cube in a MOLAP (multidimensional OLAP) structure, a ROLAP (relational OLAP) database, or a HOLAP (hybrid OLAP) combination of multidimensional structure and relational database. There are advantages and disadvantages to each storage strategy.

MOLAP storage uses a multidimensional structure to contain aggregations and a copy of the base data. MOLAP storage provides the potential for the most rapid query response times, depending only on the percentage and design of the cube’s aggregations. In general, MOLAP is more appropriate for cubes with frequent use and the necessity for rapid query response.

ROLAP storage uses tables in the data warehouse relational database to store a cube’s aggregations. In contrast to MOLAP storage, ROLAP does not store a copy of the base data, accessing the original fact table when necessary to answer queries. ROLAP query response is generally slower than that available with the other two storage strategies. A typical use of ROLAP is for large data sets that are infrequently queried, such as historical data from less recent previous years.

HOLAP storage combines attributes of both MOLAP and ROLAP. Aggregation data is stored in MOLAP structures and the base data is left in the data warehouse’s relational database. For queries that access summary data, HOLAP is the equivalent of MOLAP. Queries that access base data, such as a drill-down to a single fact, must retrieve data from the relational database and will not be as fast as if the base data were stored in the MOLAP structure. Cubes stored as HOLAP are smaller than equivalent MOLAP cubes and respond faster than ROLAP cubes for queries involving summary data. HOLAP storage is generally suitable for cubes that require rapid query response for summaries based on a large amount of base data.

Microsoft® SQL Server™ OLAP Services supports all three storage modes. The Storage Design wizard provides options for you to choose the storage mode most appropriate for your cube.

Note Aggregations cannot be created for a cube with ROLAP storage if the data source is OLAP Services (that is, if the provider is “Microsoft OLE DB Provider for OLAP Services”).

Partitions

Caution Partitioning cubes and merging partitions are advanced techniques - it is possible to create partitioned cubes that contain incorrect data. For more information about specific precautions, see Partitions in Advanced Topics.

Cubes can be divided into partitions, each of which can be stored using a different mode. For example, you can create a cube of several years’ worth of data and partition it at year boundaries. You can store the current year’s data partition in a MOLAP structure with a high percentage of aggregations for quick response to users. You can use HOLAP to store the previous year’s data partition, providing good response to summary queries with reduced storage needs. You can store data for years prior to the previous year in one or more ROLAP partitions with a smaller percentage of aggregations, saving on storage space with a tradeoff in query response.

A cube’s partitions are invisible to the user. In the preceding example, any query valid for the entire cube will execute, but queries that return older data will take more time than those that request current information.

OLAP Services provides a Partition wizard to assist in creating partitions. However, it is important that partitions be defined to contain mutually exclusive data. A cube may return incorrect results for some queries if a portion of the cube's data is included in more than one of its partitions.

A cube’s partitions can be stored on different servers, providing a clustered approach to cube storage.

Two partitions of a cube can be merged into a single partition, which can then be merged into another partition, and so on until only a single partition remains. For example, four partitions, each containing data for a quarter, can be merged into a single partition that contains the data for the entire year. There are precautions that need to be considered when merging partitions to ensure the resulting partition contains correct data.

For precautions and more information about partitions, see Partitions in Advanced Topics.


Aggregations

Aggregations are precalculated summaries of data that improve query response time by having the answers ready before the questions are asked. For example, a query requesting the weekly sales totals for a particular product line from a data warehouse fact table that contains hundreds of thousands of rows of transactions can take a long time to answer if the fact table has to be scanned to compute the answer. The response can be almost immediate if the summarization data to answer this query has been precalculated. Precalculation of summary data is the foundation for the rapid response times of OLAP technology.

Cubes are the way OLAP technology organizes summary data into multidimensional structures. Dimensions and their hierarchical levels reflect the queries that can be asked of the cube. Aggregations are stored in the multidimensional structure in cells at coordinates specified by the dimensions. For example, the question “What were the sales of product X in 1998 for the Northwest region?” involves three dimensions (product, time, and geography) and one measure (sales). The value in the sales cell within the cube at the coordinates (product X, 1998, Northwest) is the answer, a single numerical value.

Other questions may return multiple values, such as “What were the sales of hardware products by quarter by region for 1998?” Such queries return sets of cells from the coordinates that satisfy the specified conditions. The number of cells returned by the query depends on the number of items in the hardware level of the product dimension, the four quarters in 1998, and the number of regions in the geography dimension. If all summary data has been precalculated into aggregations, the response time of queries like this will depend only on the time needed to extract the specified cells. No calculation or reading of data from the fact table is necessary.

Precalculation of all possible aggregations in a cube results in the fastest possible response time for all queries. However, the storage and processing time required for the aggregations can be substantial. Storage requirements depend not only on the number of dimensions and measures, but also on the number of levels in the dimensions and the number of members of each level.

There is a tradeoff between storage requirements and the percentage of possible aggregations that are precalculated. If no aggregations are precalculated (0%), little storage space is required beyond that necessary to store the base data. In this case, however, query response time will vary and may be quite slow because all answers will have to be calculated from the base data for each query. Returning the single number that answers the first query above (“What were the sales of product X in 1998 for the Northwest region”) might require reading thousands of rows of data, extracting the sale value from each, and calculating the sum.

Microsoft® SQL Server™ OLAP Services incorporates a sophisticated algorithm to select aggregations for precalculation so that other aggregations can be quickly computed from precalculated values. For example, if the aggregations are precalculated for the month level of a time dimension, the calculation for a quarter requires only the summarization of three numbers, which can be quickly computed on the fly. This technique saves storage with little effect on query response time.

The Storage Design wizard provides options for you to specify storage and percentage constraints to the algorithm to achieve a satisfactory tradeoff between query response time and storage requirements. The Usage-Based Optimization wizard enables you to adjust the aggregation design for a cube by analyzing the queries that have been submitted by client applications. You can tune a cube’s aggregation design to provide rapid response to frequent queries and less rapid response to infrequent queries without substantially affecting the storage needed for the cube.


Implementing an OLAP Solution

Microsoft® SQL Server™ OLAP Services provides a variety of tools and objects to support your needs as you implement an OLAP solution with your data warehouse. Often a number of possible combinations of these components can solve a problem. This section includes descriptions of the available elements, a topic on how they can be used to solve problems, and a discussion about maintaining and synchronizing OLAP data with data in the data warehouse.

The primary element of OLAP is the cube, which contains the data of interest to users. Cubes organize data into dimensions and measures in a multidimensional structure to support the questions users want to ask about organizational data. For example, consider the question, “What was our total sales of hardware in the northwest region in the first quarter of this year?” The cube of data that can answer this question includes three dimensions and one measure:

  • Product dimension - contains hardware category
  • Geography dimension - contains the northwest region
  • Time dimension - contains the first quarter of this year
  • Sales measure - quantitative numerical data that can be summarized

OLAP Services provides additional objects and advanced features that enable you to create sophisticated solutions for more complex business needs:

  • Shared dimensions - can be used in multiple cubes
  • Calculated members - mathematical combinations of measures or dimension members
  • Virtual cubes - logical combinations of cubes
  • Member properties - information about dimension members
  • Virtual dimensions - dimensions of member properties
  • Write-enabled cubes - cubes that users can update
  • Partitions - storage containers for cube data


Administrator's Guide

Administrator’s Guide

The purpose of the Administrator’s Guide is to instruct and assist administrators of Microsoft® SQL Server™ OLAP Services. Administrators’ duties may include:

  • Designing, building, and maintaining a data warehouse.
  • Creating and maintaining multidimensional structures within OLAP Services.
  • Maintaining security on multidimensional structures.

The Administrator’s Guide is a companion to the Administrator’s Reference.

The Administrator’s Guide contains the following topics:

  • Data Warehousing and OLAP

    Provides an overview of data warehouses and online analytical processing (OLAP).

  • Implementing an OLAP Solution

    Describes the OLAP tools and objects provided with OLAP Services.

  • The OLAP Manager

    Describes the user interface for OLAP Services and procedures for creating and maintaining OLAP objects.

  • Security

    Describes security for OLAP Services.


The OLAP Manager

Microsoft® SQL Server™ OLAP Services version 7.0 includes the OLAP Manager, a console application that provides a robust user interface for accessing OLAP servers and the metadata repositories that define multidimensional database structures. Use the OLAP Manager to:

  • Specify databases and data sources
  • Build and process cubes
  • Specify storage options and optimize query performance
  • Manage server security
  • Browse your data sources, shared dimensions, and security roles
  • Find links for third-party client applications, support resources, Help updates, and product news
  • Obtain information about the complete SQL Server 7.0

The OLAP Manager’s HTML pane assists you in learning the concepts and terminology of online analytical processing (OLAP) as well as how to store and manage multidimensional data. It also includes a step-by-step tutorial on building and deploying an OLAP cube.


Defining Data Sources in the ODBC Data Source Administrator

Microsoft® SQL Server™ OLAP Services supports OLE DB and ODBC data sources. If you are using only OLE DB data sources as input to OLAP Services, skip this procedure.

Before you start the OLAP Manager, ensure all ODBC data sources that will provide input to OLAP Services are defined in the ODBC Data Source Administrator.

To start the ODBC Data Source Administrator

  1. On your desktop click Start, point to Settings, and then click Control Panel.
  2. Double-click ODBC Data Sources.

For more information about the ODBC Data Source Administrator, refer to its Help.

Note Client administrators of OLAP Services must also define the same data sources on their computers.


Processing Cubes Using the OLAP Manager

This topic describes complete processing of a cube. Perform this type of processing on a cube after you complete any of the following activities:

  • Build the cube and design its storage options and aggregations.
  • Change the cube’s metadata (measures, dimensions, and so on) and decide to incorporate the changes in the cube.
  • Change the structure of a shared dimension used in the cube and process the shared dimension.

Caution If a shared dimension’s structure is updated and saved but not processed, it will automatically be processed when any cube incorporating the dimension is processed. At that time any other cubes that incorporate the dimension immediately become unavailable to users and must be processed before they can be used again.

Virtual cubes also require complete processing after you build them, change their metadata, or change one of their shared dimensions.

This type of processing completely restructures a cube and recalculates and reloads its data.

Other, less extensive types of updates to cubes are adequate in other situations. For more information, see Updating and Refreshing Cube Data.

Referential integrity of the data warehouse is not verified by Microsoft® SQL Server™ OLAP Services. So, for example, if the cube’s fact table contains foreign key values that are not present in a joined dimension table’s primary key column, the rows containing those values are not processed. In this case, processing does not produce an error message, but the cube contains incomplete and therefore inaccurate data.

Depending on the size of your cube, processing may take considerable time.

The storage required for temporary files during processing can be substantially larger than the final size of the cube. If during processing you exhaust the free space of the disk containing your temporary file folder, you can specify a folder on another disk with more free space. For more information, see Properties Dialog Box - General Tab.

Note Newly processed cubes are visible to client users only after they reconnect to the server computer.

To process a cube

  1. In the OLAP Manager tree view, under a database, expand the Cubes folder.
  2. Right-click the cube, and then click Process.
  3. In the Process a Cube dialog box, click Process, and then click OK.
  4. In the Process dialog box, wait for the cube to finish processing, or click Stop to halt and cancel processing.

To process a virtual cube

  1. In the OLAP Manager tree view, under a database, expand the Virtual Cubes folder.
  2. Right-click the virtual cube, and then click Process.
  3. In the Process dialog box, wait for the virtual cube to finish processing, or click Stop to halt and cancel processing.

After processing completes but before you close the Process dialog box, you can view the SQL statement used to process the cube.

To view an SQL statement

  1. In the Process dialog box, click a line beginning with the SQL icon.
  2. Click View Details.


Security

You can restrict access to data managed by Microsoft® SQL Server™ OLAP Services via the security features. Using security features, you can control who has access to data and the types of operations they can perform with the data. OLAP Services supports a Microsoft Windows NT® integrated security system and allows you to assign access permissions at the database and cube (including virtual cube) level.

Security is controlled via access control rights that are managed using roles. Access control rights determine the type of access to data. Roles define categories of users with the same access control.

Note Access control rights are enabled only if the server is installed on the Windows NT NTFS file system, which enforces access control lists (ACLs). Access control rights cannot be enforced on a file system such as file allocation table (FAT) that does not support ACLs.

Topics in this section cover:

  • Authentication.
  • Access Control.
  • Roles.
  • Operational Considerations.


Authentication

Microsoft® SQL Server™ OLAP Services imposes user security restrictions based on the access rights the user has been granted by the operating system. OLAP Services uses Security Support Provider Interface (SSPI) as the interface to Microsoft Windows NT® security for authentication, and supports the authentication scheme of NT LM Security Support Provider. Authentication occurs at the operating system level when a user logs on to a Windows NT domain. Access to OLAP Services requires the user to be a member of the same domain as the user account under which the server was installed, or to be a member of a trusted domain. A user is denied access if the user’s account cannot be authenticated against a trusted domain.


Access Control

Microsoft® SQL Server™ OLAP Services controls access to Database and Cube objects via access control rights. These rights are enabled only if the server is installed on the Microsoft Windows NT® NTFS file system, which enforces access control lists (ACLs). Access control rights cannot be enforced on a file system such as file allocation table (FAT) that does not support ACLs.

OLAP Services provides three levels of access control: Read, Read/Write, and Admin.

Read

Provides read-only access to the data. Supported functionality includes browsing of data and data structures (metadata). This level does not allow modifying data and processing of data. This level of access control is supported explicitly via the OLAP Manager user interface.

Read/Write

Provides write access to a write-enabled cube. Supported functionality includes all read access functionality and modifying data in cubes designated and enabled for write-back. This level of access control is supported explicitly via the OLAP Manager user interface.

Admin

Provides access to the OLAP Manager user interface and allows processing of data. By default, the user account used to install the server on a particular computer has Admin privileges on that computer. Upon initial installation, OLAP Services establishes a Windows NT group named OLAP Administrators and adds the logged-in user to this group. Only members of this group can start the OLAP Manager user interface and use administrative functions, including security management. You can use the Windows NT User Manager to manage this group.

Note If the service logon account specified in the Service dialog box of Windows NT is not System Account, the specified account has all three levels of access control: Read, Read/Write, and Admin.


Roles

Roles are used to map Microsoft® Windows NT® user accounts and user groups to security category assignments for cubes.

Roles are created and managed at the database level. These can then be assigned to specific cubes within the database. You can use the Manage Roles dialog box to assign roles to a specific cube and specify the access privileges of the assigned roles as they apply to the cube.

For more information about roles, see Creating Security Roles.


Operational Considerations

Automatic Detection of End User’s Domain Logon Authorization

Microsoft® SQL Server™ OLAP Services automatically detects a connecting end user’s logon user name and authorization obtained when the end user logged onto the domain. If when the end user connects, he or she specifies a user name and password different than his or her logon user name and password, the specified user name and password are ignored.

Service Logon Account Permissions to Data Sources

The service name for OLAP Services is MSSQLServerOLAPService. The logon account associated with this service must have permissions to access data sources that OLAP Services administrators can access through the OLAP Manager. Otherwise, the OLAP Services administrators will not be able to process the multidimensional objects they maintain using the OLAP Manager.

The service logon account is specified in the Service dialog box of Microsoft Windows NT® on the server computer.

To display the Service dialog box

  1. On your desktop click Start, point to Settings, and then click Control Panel.
  2. Double-click Services.
  3. Click MSSQLServerOLAPService.
  4. Click Startup.

For more information about the Service dialog box, refer to its Help.

Accessing Your Cube from Another Workstation

It is possible for a user who creates a cube to be denied access to the cube. This can occur when the user logs on at a workstation other than the one hosting OLAP Services and attempts to view data in the cube on the server computer. A common cause for this problem is that the user was logged on under a local account on the server computer when the cube was created, and then logged on under a local account on the second computer. The cube owner’s access control list (ACL) reflects the local account on the server computer, not the local account on the second computer, and the user is denied access.

To avoid this problem, always log on under a domain account when you create cubes, and then log on under the same domain account on other computers.

Alternatively, you can assign a role to the cube when it is created. You are then able to access the cube from any computer, if you log on under an account granted access by the role.

Changing a User’s Access Rights

The time that elapses between a change to a user’s access rights in OLAP Services and the actual effect of the change depends on the value of the Auto Synch Period initialization property, the user’s actions, and how long the user maintains a connection. The value of this property controls the frequency (in milliseconds) of client/server synchronization, including revalidation of access rights. This value defaults to 10,000 milliseconds (10 seconds), but is passed to OLAP Services in each connection string. Thus, the default can be overridden by users and client applications and can vary from user to user and client to client.

If the Auto Synch Period property is set to null or 0 (zero), synchronization does not occur at a constant interval. It occurs due to users’ actions; therefore, the time that synchronization will occur cannot be predicted accurately. In this case, changes made to access rights while a user is connected to a cube do not take effect until synchronization occurs or the user disconnects from the cube. After a user has been granted access to a cube, that user can remain connected to the cube for the duration of a query session until synchronization occurs. A user cannot be forcibly disconnected from a cube during a query session after access has been granted. If the user’s access rights are removed during the query session, the user will not be able to reconnect to the cube after disconnecting from it.

If the Auto Synch Period property is set to a non-null, non-zero value, at the specified interval, users’ logon user names and authorizations are compared to their access rights defined in OLAP Services. At that time, changes to a user’s access rights that occurred since the last synchronization take effect immediately. For example, if a user’s access rights to a cube have been removed, the user is immediately unable to access the cube.

Protecting OLAP Data

It is important to for you to protect the security of your OLAP data. As with all database products, this includes judicious assignment of administrative permissions. All users who have administrative permissions to OLAP servers should be careful when they use Web browsers, productivity applications, and e-mail.

It is recommended that you establish specific Windows NT accounts to administer OLAP Services and require administrators to refrain from accessing Web pages, productivity applications, and e-mail applications that support scripts or macros when using these administrative accounts. If it is necessary to use an application that supports scripts or macros when you are logged on as an administrator, set security to the highest level and never accept any control or object that is not marked script safe. Note that Decision Support Objects (DSO) is not marked script safe, and your browser will provide a prompt before loading DSO. You should reject the loading of DSO in this way unless you are certain the application loading it is trusted.

It is also recommended that you use Windows NT Authentication for connections between OLAP servers and SQL Servers that are used as data sources for OLAP databases.


Creating Security Roles

This topic describes procedures for enabling cube users to access cube data. For information about enabling administrators to access cube data and metadata, see Access Control.

Microsoft® SQL Server™ OLAP Services uses Microsoft Windows NT® user accounts and groups to define roles for user access to databases and cube data. Essentially, you combine user accounts and groups into roles and then assign the roles to cubes. Set up these user accounts and groups in Windows NT User Manager before creating roles in OLAP Services.

To implement cube-specific security using roles, you must perform two procedures. First, you create roles for each database by combining user accounts and groups. Second, for each cube in the database, you select the roles that can access the cube. These procedures are described this topic.

The default permission for roles is read (that is, read-only), but you can also allow read/write permission for select role-cube combinations. Read/write permission allows users in the role to save changes to the cube’s data. However, because the changes are saved separately from the original cube data, they affect only displayed cube data and can be deleted if necessary. The separately stored changes are called write-back data. For more information, see Maintaining Write-Enabled Cubes and Write-Back Data.

To create a role for a database, use the Create a Database Role dialog box.

To create a database role

  1. In the OLAP Manager tree view, under a database, expand the Library folder.
  2. Right-click the Roles folder, and then click New Role.
  3. In the Create a Database Role dialog box, type a role name and description.
  4. Click Groups and Users.
  5. In the Add Users and Groups dialog box, in the List Names From list, click the domain from which to select users and groups.
  6. To display users under Names, click Show Users.
  7. To display a group’s members, click the group, and then click Members.
  8. To add a user or group to the role, click the user or group, and then click Add.
  9. After you have added all desired users and groups to the role, click OK.
  10. In the Create a Database Role dialog box, click OK.

After you create all required database roles, use the Manage Roles dialog box to select the database roles that can access a cube.

To select the database roles that can access a cube

  1. In the OLAP Manager tree view, under a database, expand the Cubes folder.
  2. Right-click the cube, and then click Manage Roles.
  3. In the Manage Roles dialog box, select the roles that will access the cube, and then click > (Add).
  4. To grant read/write permission to a role, under Cube access, click the role, and then select Grant read/write permission.
  5. Click OK.

Read/write permission granted to a role is effective only if the cube is write-enabled. For more information, see Write-Enabling a Cube.

After you change the roles of a cube, you must process dependent virtual cubes to provide users continuing access to them. (This processing is much faster than processing the component cubes if the component cubes’ structures have not changed since their last processing.) When you change the roles, virtual cube users connected to the server computer are unaffected as long as they remain connected. However, until you process the dependent virtual cubes, users who connect will be unable to see them.

See Also

Security


Creating Shared Dimensions

Dimensions are descriptive categories by which the numeric data (that is, measures) in a cube can be separated for analysis. For example, if a cube’s measure is Cost, and its dimensions are Time, Supplier, and Item Description, users of the cube can separate Cost into various categories of Time, Supplier, and Item Description.

A shared dimension is a dimension available to multiple cubes in a database. You should create shared dimensions for common dimensions, such as time, that will be added to multiple cubes.

To quickly and easily create a shared dimension, use the Dimension wizard. The wizard takes you through steps to specify the following definitions for your shared dimension:

  • One or multiple dimension tables

    Specify whether the shared dimension will be created from one or multiple dimension tables.

    • One: If you add the shared dimension to a cube, and the shared dimension table joins to the fact table, the cube’s schema type (star or snowflake) is not affected. If the shared dimension table joins to another dimension table, the cube will have a snowflake schema.
    • Multiple: If you add the shared dimension to a cube, its schema type will be snowflake.
  • Data source

    Select the data source that contains the tables and columns that define your shared dimension. A data source name identifies a database resource and parameters for its usage. You can select a previously defined data source or specify a new one.

  • Dimension table

    Select the dimension table or tables that contain the column or columns you want in your shared dimension. A dimension table is simply a table that contains a dimension. It is a peripheral table joined to a central fact table in a cube’s schema.

  • Dimension type

    Specify whether the shared dimension is a standard or time dimension.

  • Dimension levels

    Select the levels you want in your shared dimension. Each level is defined by a column (except in some time dimensions). Levels within a dimension are organized hierarchically. For example, in a Location dimension, the levels might be Country, State, and City. The values (that is, members) in each level determine the column and row headings that users see when they browse the cube with a tabular browser. (In graphical browsers, users see other types of descriptive labels produced by the members. For example, each member produces a value on the scale of an axis.)

    If the dimension is a time dimension, and a column with the datetime data type is available in the dimension table, select the column and the levels to create. The wizard parses the column to create multiple levels.

For more information about dimensions, see Dimensions and its subtopics.

To start the Dimension wizard

  1. In the OLAP Manager tree view, under a database, expand the Library folder.
  2. Right-click the Shared Dimensions folder, point to New Dimension, and then click Wizard.

After you complete the wizard, the Dimension editor appears so that you can further refine the dimension.

You can also use the Dimension editor to update existing shared dimensions.

To display the Dimension editor

  1. In the OLAP Manager tree view, under a database, expand the Library folder, and then expand the Shared Dimensions folder.
  2. Right-click a shared dimension, and then click Edit.

After you update a shared dimension or its table, you must process it. You can process a shared dimension in two ways:

  • Incremental update

    Processes the addition of members (that is, rows) to the dimension table. This method does not process changes to a dimension’s structure or relationships among members.

  • Rebuild the dimension structure

    Processes changes to a dimension’s structure such as adding, deleting, or moving a level. This method also processes changes to member relationships such as moving a member from one parent member to another.

Important When a shared dimension is processed with the Rebuild the dimension structure option, all cubes that incorporate the shared dimension immediately become unavailable to users and must be processed before they can be used again.

Caution If a shared dimension’s structure is updated and saved but not processed, it will automatically be processed when any cube incorporating the dimension is processed. At that time any other cubes that incorporate the dimension immediately become unavailable to users and must be processed before they can be used again.

To incrementally update a shared dimension or rebuild a shared dimension’s structure, use the Process a Dimension and Process dialog boxes.

To incrementally update a shared dimension

  1. In the OLAP Manager tree view, under a database, expand the Library folder, and then expand the Shared Dimensions folder.
  2. Right-click the shared dimension, and then click Process.
  3. In the Process a Dimension dialog box, click Incremental update, and then click OK.
  4. In the Process dialog box, wait for the incremental update to finish processing or click Stop to halt and cancel processing.

To rebuild a shared dimension’s structure

  1. In the OLAP Manager tree view, under a database, expand the Library folder, and then expand the Shared Dimensions folder.
  2. Right-click the shared dimension, and then click Process.
  3. In the Process a Dimension dialog box, click Rebuild the dimension structure, and then click OK.
  4. In the Process dialog box, wait for the rebuild to finish processing or click Stop to halt and cancel processing.

After you process a shared dimension using the Rebuild the dimension structure option, you must process all of the cubes that include the dimension. For more information, see Processing Cubes Using the OLAP Manager.


Creating Member Properties

Member properties are optional components of dimensions and cubes.

Member properties are associated with members. A member is an item in a dimension level. For example, if a Time dimension contains Year, Month, and Day levels, and the dimension table’s data spans one full calendar year, the Month level contains 12 members: January through December. If the Time dimension table’s data spans two full calendar years, the Month level contains 24 members. Thus, members need not be unique values within a dimension level.

A member property is an attribute associated with a member. For example, each member of the Month level has an associated Boolean member property called Bonus Month. It records whether bonuses are awarded during the month because they are not awarded at a regular frequency. In months that bonuses are awarded, Bonus Month equals 1 (TRUE); in the remaining months, Bonus Month equals 0 (FALSE).

A member property is stored in a column in the same table as the dimension level containing the members. So, for example, Bonus Month is stored in the same table as the Month level.

A member property is created by inserting it into the level that contains the members with which the member property is associated. So, for example, Bonus Month is defined inside the Month level.

A member property is created in a dimension for the purpose of providing cube users with additional information about members. The information is typically less important to users than the members themselves and does not qualify as a level within the dimension.

For example, before Bonus Month existed as a member property, it existed as a column in the Time dimension table. Users requested that Bonus Month be added to some cubes. However, it was inappropriate to add Bonus Month as a level because it is not a natural component of the Time dimension hierarchy, and users may have drilled down, for example, from Month to Bonus Month to Day, experiencing an awkward and confusing presentation. Because Bonus Month is associated with members of the Month level, the solution was to create the Bonus Month member property by inserting it in the Month level. Consequently, users can now display Bonus Month values, for example by right-clicking Month values, and the basic Time dimension hierarchy is undisturbed.

Before you create a member property in a dimension level containing nonunique members, you must ensure that each member can have only one member property value. Otherwise, cube data will be incomplete and misleading because only one member property value can be displayed for each member. For example, members of the Salesperson level are not unique. Each Salesperson can have only one Manager, so Manager is a valid member property in the Salesperson level. However, a Salesperson can work in multiple Regions, so Region is not a valid member property. If Region were defined as a member property, it would display only one Region to cube users, even for Salespersons who work in multiple Regions.

Member properties are also used in the creation of virtual dimensions. For more information about virtual dimensions, see Creating Virtual Dimensions.

For more information about member properties, see Member Properties.

To create a member property in a dimension level, use the Dimension editor. You can create member properties only in shared dimensions.

To create a member property

  1. In the OLAP Manager tree view, under a database, expand the Library folder, and then expand the Shared Dimensions folder.
  2. Right-click the shared dimension containing the level in which you want to create a member property, and then click Edit.
  3. In the Dimension editor, right-click the level in which you want to create a member property, and then click New Member Property.
  4. In the Select Column dialog box, click the column that defines the member property, and then click OK.

After you create a member property, you must process the dimension that contains it with the Incremental update option. For more information, see Creating Shared Dimensions.

Users must then reconnect to the server computer in order to access the member property.

Note Member properties are not visible in the OLAP Manager tree view. You must use the Dimension editor or the Cube editor to view them. You must use the Dimension editor to create, update, or delete them.


Creating Virtual Dimensions

Although all cubes require dimensions, they do not require virtual dimensions.

The main benefits of virtual dimensions are storage savings and reduced cube processing time. Aggregation data for virtual dimensions is not stored. It is calculated in memory. Therefore, if you add a virtual dimension to a cube, its storage usage and processing time do not increase as when you add an ordinary dimension.

Virtual dimensions also allow you to display categorical labels from a single dimension table on multiple axes in browsers without increasing cube size. (Without virtual dimensions, multiple ordinary dimensions would be required.) Specifically, you can display the members of a dimension level on one axis and an associated attribute (that is, member property) of those members on the other axis. This type of presentation is useful when cube users want to explore the trends of measures depending on the relationship between members and member properties. For example, a user requests to analyze Sales by Product Name and Package Material to explore customers’ preferences for recyclable Package Materials. If the Product dimension already contains Product Name, add Package Material as a member property and create a virtual dimension from it. After you add the virtual dimension to the cube, the user can cross-reference Product Names and Package Materials and compare the Sales at the intersections.

Virtual dimensions are created from member properties. You can add a virtual dimension to a cube only if the dimension that supplies the member property is also included in the cube. For more information about member properties, see Creating Member Properties.

All virtual dimensions are shared, not private.

To quickly and easily create a virtual dimension, use the Virtual Dimension wizard. The wizard allows you to select the member property that defines the virtual dimension.

To start the Virtual Dimension wizard

  1. In the OLAP Manager tree view, under a database, expand the Library folder.
  2. Right-click the Virtual Dimensions folder, and then click New Virtual Dimension.


Specifying Data Sources

For each of your databases, specify one or more data sources that will provide data for your cubes. As described in the following procedure, the OLAP Manager retrieves a list of OLE DB data sources and ODBC data sources defined in the ODBC Data Source Administrator. Thus, you can easily select a data source from this list.

To specify a data source, use the Data Link Properties dialog box.

To specify a data source

  1. In the OLAP Manager tree view, expand the database that will draw data from the data source, and then expand the Library folder.
  2. Right-click the Data Sources folder, and then click New Data Source.
  3. In the Data Link Properties dialog box, on the Provider tab, click an OLE DB provider.

    Note The Provider tab does not appear for all types of data sources.

  4. On the Connection tab, click Use data source name, click the down arrow to display a list of data source names, and then click a data source.

    If the data source you want to select does not appear in the list, you must define one. Define the data source in the ODBC Data Source Administrator, and then return to the Connection tab and click Refresh. For more information, see Defining Data Sources in the ODBC Data Source Administrator.

  5. To determine whether the data source is correctly connected, click Test Connection. If the connection is okay, you receive a message stating “Test connection succeeded.” Click OK to clear the message.
  6. In the Data Link Properties dialog box, click OK.


Updating and Refreshing Cube Data

Many changes you make within the OLAP Manager and all changes to a cube’s source data require the cube to be processed in order for the changes to be reflected in the cube’s data.

You can process a cube in three ways:

  • Incremental update

    Adds new data to a partition in the cube and updates aggregations. This method does not process changes to a cube’s structure (measures, dimensions, and so on) or changes to its existing source data. An incremental update creates a temporary partition from the new data and merges it into an existing partition.

  • Refresh data

    Clears and reloads a cube’s data and recalculates its aggregations. Use this method if the cube’s source data has changed but its structure has not.

  • Complete process

    Completely restructures a cube based on its current definitions and then recalculates its data.

For more information about the kinds of changes processed by the preceding methods, see Processing Cubes.

The remainder of this topic describes procedures for only the first two of the preceding methods. For more information about the third method and associated procedures, see Processing Cubes Using the OLAP Manager.

Referential integrity of the data warehouse is not verified by Microsoft® SQL Server™ OLAP Services. So, for example, if the cube’s (or one of its partition’s) fact table contains foreign key values that are not present in a joined dimension table’s primary key column, the rows containing those values are not processed. In this case, processing does not produce an error message, but the cube contains incomplete and therefore inaccurate data.

To incrementally update a cube or refresh a cube’s data, use the Process a Cube and Process dialog boxes.

To incrementally update a cube

Caution This procedure updates a partition. Incorrect use of partitions can result in inaccurate cube data. For more information, see Partitions and its subtopics.

  1. In the OLAP Manager tree view, under a database, expand the Cubes folder.
  2. Right-click the cube, and then click Process.
  3. In the Process a Cube dialog box, click Incremental update, and then click OK.
  4. In the Incremental Update wizard:
    1. In the Welcome step, click Next.
    2. If the cube contains multiple partitions, the Select a partition to update step appears. In the Partition box, select the partition to update, and then click Next.
    3. In the Data source box, select the data source that contains the data to add to the partition. You can select the same data source used by the partition or a different one. By default the same data source used by the partition is initially displayed. To select a different data source, click Change, select the data source, and then click OK. If you select a different data source, it must contain a fact table with the same structure and columns as the partition’s fact table, and it must contain dimension tables with the same structure and columns as the partition’s dimension tables.
    4. In the Fact table box, select the table that contains the data to add to the partition. You can select the partition’s fact table or a different table. By default the partition’s fact table is initially displayed. If you select this table, you must use a filter, as described below, to ensure that only data not already in the partition is added. To select a different table, click Change, select the table, and then click OK. If you select a different table, it must have the same structure and columns as the partition’s fact table. You must also manually merge the table with the partition’s fact table after the incremental update completes. For more information, see Fact Table Considerations when Merging Partitions. Click Next.
    5. Specify a filter (WHERE clause expression) to limit the data selected from the fact table and added to the partition. A filter is required if you select the partition's fact table as the fact table for the incremental update (that is, if you select the default fact table). For more information, see Filters. Click Next.
    6. Click Finish.
  5. In the Process dialog box, wait for the incremental update to finish processing, or click Stop to halt and cancel processing.

To refresh a cube’s data

  1. In the OLAP Manager tree view, under a database, expand the Cubes folder.
  2. Right-click the cube, and then click Process.
  3. In the Process a Cube dialog box, click Refresh data, and then click OK.
  4. In the Process dialog box, wait for the data refresh to finish processing, or click Stop to halt and cancel processing.

After processing completes but before you close the Process dialog box, you can view the SQL statement used to incrementally update or refresh the cube. This statement includes any filter specified in the Incremental Update wizard.

To view an SQL statement

  1. In the Process dialog box, click a line beginning with the SQL icon.
  2. Click View Details.


Analyzing Usage Patterns

To quickly and easily produce an on-screen report of a cube’s query patterns, use the Usage Analysis wizard. The following reports are available:

  • Query Run-Tme Table: a table showing the run time of queries, ordered from the longest to the shortest run time.
  • Query Frequency Table: a table showing the frequency of queries, ordered from the most to the least frequent.
  • Active User Table: a table showing users and the number of queries they have sent. Queries are ordered from the most to least queries sent per user.
  • Query Response Graph: a bar graph showing the response time for all queries.
  • Query By Hour Graph: a bar graph showing the total number of queries processed, grouped by hour.
  • Query By Date Graph: a bar graph showing the total number of queries sent, grouped by date.

You can limit the reports to select queries, based on several criteria.

To start the Usage Analysis wizard

  1. In the OLAP Manager tree view, under a database, expand the Cubes folder.
  2. Right-click a cube, and then click Usage Analysis.

Note The reports’ contents are affected by the options that control query logging. The reports retrieve data from the query log, which by default records every tenth query. Therefore, by default the reports reflect only every tenth query. You can change an option to record at any interval up to 1 in 10,000. Other options are turning off query logging and clearing the log, which also affect the reports’ contents. For information about these options, see Properties Dialog Box - Query Log Tab.


Optimizing Performance Based on Usage

To quickly and easily improve a cube’s or partition’s performance based on patterns of past query usage, use the Usage-Based Optimization wizard. The wizard takes you through steps to specify the following definitions for optimization:

  • Partition

    If the cube contains multiple partitions, select the partition to optimize. (You can optimize only one partition at a time.) Partitions are the storage containers for data and aggregations of a cube. Multiple partitions are transparent to the user who sees only the total cube. For more information about partitions, see Partitions.

    Important If in the future you might merge partitions, do not use the Usage-Based Optimization wizard to optimize them or their parent cubes. The wizard changes a partition’s aggregations. Merged partitions must have identical aggregations.

  • Queries

    Select the queries upon which to base optimization.

    Note The Usage-Based Optimization wizard is affected in part by options that control query logging. The wizard relies on records you select from the query log, which by default records one in every ten queries. You can change an option to record at any interval up to 1 in 10,000. Other options are turning off query logging and clearing the log, which also affect the wizard. For information about these options, see Properties Dialog Box - Query Log Tab.

  • Storage option

    If no aggregations exist, or if you choose to replace existing aggregations, select a storage option:

    • MOLAP (multidimensional OLAP): stores aggregations and a copy of the partition’s source data in a multidimensional structure.
    • ROLAP (relational OLAP): stores aggregations in a relational structure and leaves the partition’s source data in its existing relational structure.
    • HOLAP (hybrid OLAP): stores aggregations in a multidimensional structure and leaves the partition’s source data in its existing relational structure.

    Each storage option has advantages and disadvantages. For more information, see Storage Modes (MOLAP, ROLAP, HOLAP).

  • Aggregations.

    Select a method of controlling the number of aggregations the wizard will create. Then let the wizard create the aggregations.

    Aggregations are precalculated summaries of cube data that help enable Microsoft® SQL Server™ OLAP Services to provide rapid query responses.

    The goal is to create the optimal number of aggregations. This number should not only provide satisfactory response time but also prevent excessive partition size. A greater number of aggregations produces faster response time but also requires more storage space. Moreover, as the wizard creates more and more aggregations, earlier aggregations produce considerably larger performance gains than later aggregations. Therefore, control the number of aggregations the wizard creates by one of the following methods available in the wizard:

    • Specify a storage space limit for the aggregations.
    • Specify a performance gain limit.
    • Stop the wizard manually when the displayed Performance vs. Size curve starts to level off at an acceptable performance gain.

    For more information about aggregations, see Aggregations.

To start the Usage-Based Optimization wizard

  1. In the OLAP Manager tree view, under a database, expand the Cubes folder.
  2. Right-click a cube, and then click Usage-Based Optimization.

After you add to or replace the partition’s aggregations using the wizard, you must process the partition. The final step of the wizard allows you to process or defer processing. Depending on the size of the partition, processing may take considerable time.


Maintaining Write-Enabled Cubes and Write-Back Data

If you write-enable a cube, users in roles that are granted read/write permission to the cube can change displayed cube data while they browse it. However, the changes are saved in a separate table called a write-back table, not in the cube data or source data. Users who browse a write-enabled cube see the net effect of all changes in the write-back table for the cube.

You can browse or delete write-back data. You can also convert write-back data to a partition.

Note Converting to a partition is available only if you install Microsoft® SQL Server™ OLAP Services, Enterprise Edition.

For more information, see Write-Enabled Cubes.


Write-Enabling a Cube

If you write-enable a cube, users in roles that are granted read/write permission to the cube can record changes to cube data while they browse the cube. Changes are recorded in the write-back table, separate from the cube data and its source data. Users who browse a write-enabled cube see the net effect of all changes in the write-back table for the cube.

For more information about roles and read/write permission, see Creating Security Roles.

To write-enable a cube, use the Write-Enable dialog box.

To write-enable a cube

  1. In the OLAP Manager tree view, under a database, expand the Cubes folder.
  2. Right-click the cube, and then click Write-Enable.
  3. In the Write-Enable dialog box, in the Table name box, type a name for the write-back table.
  4. In the Data source box, select a data source name.

    To specify a new data source, click New. In the Data Link Properties dialog box, specify the new data source, and then click OK. For more information, see Specifying Data Sources.

  5. In the Write-Enable dialog box, click OK.


Migrating OLAP Services Repositories

For each OLAP server, Microsoft® SQL Server™ OLAP Services creates a repository to store metadata for multidimensional objects such as cubes, dimensions, and so on. By default, this repository, called the “OLAP Services repository,” is a Microsoft Access (.mdb) database on the server computer where OLAP Services is installed. By default, this database is:

..\Program Files\OLAP Services\Bin\msmdrep.mdb

You can use the Migrate Repository wizard to migrate this repository to a SQL Server (.mdf) database on the same or another server computer. Later, you can use the wizard to migrate the repository to another SQL Server database.

Important After you migrate the repository to a SQL Server database, you cannot migrate the repository back to a Microsoft Access database.

Before you start the Migrate Repository wizard, create or identify the SQL Server database you want to migrate the OLAP Services repository to.

To start the Migrate Repository wizard

  1. In the OLAP Manager tree view, expand the OLAP servers folder.
  2. Right-click the server whose OLAP Services repository you want to migrate, and then click Migrate Repository.

After migration, both the old and new databases remain; however, only the new database is used by OLAP Services. You can manually delete the old database.

If an error prevents the Migrate Repository wizard from finishing successfully, the migration is canceled, and OLAP Services continues to use the repository it used before you started the wizard.


Administrator's Reference

Administrator’s Reference

The Administrator’s Reference contains technical information about Microsoft® SQL Server™ OLAP Services such as specifications and limits. A complete copy of the online Help topics accessed by the F1 key and Help buttons is also provided for reference.


Filters

You can use filters to specify the data you want to be incorporated into a cube’s partitions. You can set filters in either the Advanced Settings dialog box or in the Incremental Update wizard. The Advanced Settings dialog box appears when you click Advanced in the last step of the Partition wizard or in the Convert to Partition dialog box. You set a filter for your partition data or incremental update by entering the criteria expression of a WHERE clause. Do not enter the keyword WHERE. The filter expression you enter will be used in a pass-through statement to be executed by the source database. The filter will not be verified for syntax until the partition or incremental update is processed.

The simplest filters are based on one or more columns in the fact table. For example, to select rows for only the West region from the Location fact table, use the following filter:

"location"."region"='West'

Because dimension tables are inner-joined to the fact table, a filter can include criteria applied against the fact table or any dimension table used by dimensions in the partition. However, to filter on dimension tables, the column names from the dimension tables must be contained in a nested SELECT statement, and the underlying database must support nested SELECT statements. The following are examples of filters that can be used in a partition for a cube that is based on the sample FoodMart database, where the cube includes the sales_fact_1997 fact table and the time_by_day dimension table (and possibly other dimension tables):

Filter using the fact table (518 is the time_id for June 1, 1997, and 547 is the time_id for June 30, 1997):

"sales_fact_1997"."time_id" BETWEEN 518 AND 547

Equivalent filter using the fact table and the time_by_day dimension table:

"sales_fact_1997"."time_id" IN

    (SELECT "time_id" FROM "time_by_day"

    WHERE "time_by_day"."the_year" = 1997

    AND "time_by_day"."the_month" = 'June')

If the underlying database supports nested SELECT statements, you can use tables not referenced by the cube definition in your filter, but you must specify the join to the fact table in your filter.

Whenever necessary to avoid ambiguity, use a qualified expression. For example, if a column name appears in multiple tables, include the table name in the expression.

Regardless of the complexity of your filter, data is only retrieved from the fact table for use in the partition.

Per 1992 ISO and ANSI standards for SQL, the examples in this topic use double quotation marks (") as delimiters for table names and column names. Microsoft SQL Server and Microsoft Access permit brackets ([]) in place of double quotation marks.

Incorrect results can be returned from cubes whose partitions contain overlapping data as a result of filter statements that are not mutually exclusive. You must ensure that no data is duplicated among multiple partitions, and that no data is duplicated within a partition.

For example, these sets of filters would be mutually exclusive within each set:

Set 1:

"SaleYear" = 1997

"SaleYear" = 1998

Set 2:

"Continent" = 'NorthAmerica'

"Continent" = 'Europe'

"Continent" = 'SouthAmerica'

Set 3:

"Country" = 'USA'

"Country" = 'Mexico'

("Country" <> 'USA' AND "Country" <> 'Mexico')

The following filter expressions, the first in one of a cube’s two partitions and the second in the other, will yield incorrect query results from the cube data because the USA data will be included in both partitions.

"Continent" = 'NorthAmerica'

"Country" = 'USA'

When you create mutually exclusive filters for partitions, ensure that the combined partition data includes all data you want for the cube.

For more information, see Partitions in Advanced Topics.


clsAggregationDimension

An object of ClassType clsAggregationDimension allows you to specify the level of granularity an aggregation will have. This object provides collections and properties through a specific implementation of the Decision Support Objects (DSO) Dimension interface. There are no methods associated with an object of ClassType clsAggregationDimension.

Remarks

An aggregation for a partition will by default aggregate values based on the top-most levels within the partition. To specify a different granularity, that is degree to which an aggregation is precalculated, you will need to add additional levels to the aggregation’s dimensions. For example, in a default scenario a cube, and consequently its partition, may contain a Time dimension that has the levels All (default), Year, Quarter, and Month. An aggregation for this partition would inherit all of the partition’s dimensions, but only the top-most or default All level. To precalculate a greater detail of data (more granularity) over the Time dimension, you will need to add one or more of the levels Year, Quarter, and Month.

For more information, see About Decision Support Objects.

Example

'Assume an object (dsoAgg) of ClassType clsAggregation exists

Dim dsoAggDim as DSO.Dimension

Set dsoAggDim = dsoAgg.Dimensions("Time")

dsoAggDim.Levels.AddNew("Year")

dsoAggDim.Levels.AddNew("Quarter")

dsoAggDim.Levels.AddNew("Month")

See Also
About Decision Support Objects | Dimension Interface
Using Decision Support Objects |


Collections, clsAggregationDimension

An object of ClassType clsAggregationDimension implements the following collections of the Dimension interface.

Collection | Description
CustomProperties | Collection of user-defined properties.
Levels | The collection of Level objects in an aggregation dimension.


Properties, clsAggregationDimension

An object of ClassType clsAggregationDimension implements the following properties of the Dimension interface.

Property | Description
ClassType | Returns an enumeration constant identifying the specific object type.
DataSource | The name of the DataSource object.
DimensionType | Returns an enumeration constant identifying the specific type of dimension.
FromClause | A comma-separated list of the tables from which the store data is obtained.
IsShared | Indicates whether the dimension is shared among cubes.
IsValid | Indicates whether the dimension structure is valid.
JoinClause | Contains the SQL JOIN clause for the dimension.
LastProcessed | The date and time when the dimension was last processed.
LastUpdated | User-specified date. Not used by OLAP Services.
Name | The dimension name.
OrdinalPosition | Returns the ordinal position of the dimension object within its parent object’s Dimensions collection.
Parent | Returns a reference to the parent MDStore object.
SubClassType | Returns an enumeration constant identifying the subclass type of the object.


clsAggregationLevel

An object of ClassType clsAggregationLevel provides a specific implementation of the Decision Support Objects (DSO) Level interface. It is used to maintain the level objects associated with an MDStore object having a ClassType of clsAggregation. This object provides collections and properties through the Level interface. There are no methods associated with an object of ClassType clsAggregationLevel.

For more information, see About Decision Support Objects.

Remarks

Levels describe the dimension hierarchy from the highest (most aggregated) level to the lowest (most detailed) level of data. The All level of a dimension is the top level of a dimension; it includes all the members of subordinate levels.

The following table shows an example of the level positions of a time dimension in which the most detailed (daily) values are included in the next level (monthly), which are in turn included in the next level (quarterly) and so on:

Level | Ordinal Position
All | 1
Yearly | 2
Quarterly | 3
Monthly | 4
Daily | 5

Note The number of members in any level must always be greater than, or equal to, the number of members in the parent level.

Example

' Assume the existence of an object (myAgg) of ClassType clsPartition

Dim myLev As DSO.Level

Set myLev = myAgg.Levels.AddNew("Brand Name")

See Also
Using Decision Support Objects


Collections, clsAggregationLevel

An object of ClassType clsAggregationLevel implements the following collections of the Level interface.

Collection | Description
CustomProperties | Collection of user-defined properties.


Properties, clsAggregrationLevel

An object of ClassType clsAggregationLevel implements the following properties of the Level interface.

Property | Description
ClassType | Returns an enumeration constant identifying the specific object type.
ColumnSize | The size of the MemberKeyColumn of the aggregation level.
ColumnType | The data type of the MemberKeyColumn of the aggregation level.
Description | The description of the level.
EstimatedSize | The estimated number of members in the level.
FromClause | Contains the SQL FROM clause for the level.
IsDisabled | Indicates whether the level is disabled.
IsUnique | Indicates whether the level members are unique.
IsValid | Indicates whether the level structure is valid.
JoinClause | Contains the SQL JOIN clause for the level.
LevelType | Returns an enumeration constant identifying the specific type of level.
MemberKeyColumn | The name of the column that contains the member key of the aggregation level.
MemberNameColumn | The name of the column that contains member names.
Name | The name of the level.
OrdinalPosition | Returns the ordinal position of the level in the parent object’s Levels collection.
Parent | Returns a reference to the parent Dimension object.
SliceValue | The value of the partition level slice.
SubClassType | Returns an enumeration constant identifying the subclass type of the object.


clsAggregationMeasure

An object of ClassType clsAggregationMeasure provides a specific implementation of the Decision Support Objects (DSO) Measure interface. It is used to maintain the measure objects contained within an aggregation object. This object provides collections and properties through the Measure interface. There are no methods associated with an object of ClassType clsAggregationMeasure.

Remarks

When a cube is processed, measures are aggregated across the dimensions in the cube. For more information, see About Decision Support Objects.

Example

Use the following code to create an object of ClassType clsAggregationMeasure.

'Assume an object (dsoAggregation) of ClassType clsAggregation

Dim dsoAggMeasure As DSO.Measure

Set dsoAggMeasure = dsoAggregation.Measures.AddNew("MyAggMea")

See Also
Using Decision Support Objects


Collections, clsAggregationMeasure

An object of ClassType clsAggregationMeasure implements the following collections of the Measure interface.

Collection | Description
CustomProperties | Collection of user-defined properties.


Properties, clsAggregationMeasure

An object of ClassType clsAggregationMeasure implements the following properties of the Measure interface.

Property | Description
AggregateFunction | A value corresponding to the type of aggregation function used for the measure.
ClassType | Returns an enumeration constant identifying the specific object type.
Description | The description of the measure.
FormatString | The format used to display the measure values.
IsInternal | Indicates whether the measure is internal to the cube; that is, it is used only for calculations of other measures.
IsValid | Indicates whether the measure structure is valid.
Name | The measure name.
OrdinalPosition | Returns the ordinal position of the measure in the parent object’s Measures collection.
Parent | Returns a reference to the parent MDStore object.
SourceColumn | The name of the measure column in the aggregated fact table.
SourceColumnType | Returns an ADO DB enumeration constant identifying the SourceColumn data type.
SubClassType | Returns an enumeration constant identifying the subclass type of the object.


clsAggregation

An object of ClassType clsAggregation provides a specific implementation of the Decision Support Objects (DSO) MDStore interface. Each instance of a clsAggregation object is used to maintain a unique DSO aggregation data store. This object provides collections, methods, and properties through the MDStore interface.

Remarks

An aggregation object may contain members that store, for example, total sales volume, by store location, by day. Another aggregation object in the same cube may store total sales volume, by store location, by week. This object aggregates the same measure (sales volume) across the same dimension (store location) but at a different level (week).

For more information about the object model hierarchy, see About Decision Support Objects and Interfaces.

Example

Use the following code to list the aggregations contained within a partition.

'Assume an object (dsoServer) of ClassType clsServer exists

    Dim dsoDB As MDStore

    Dim dsoCube As MDStore

    Dim dsoPart As MDStore

    Dim dsoAgg As MDStore

    Set dsoDB = dsoServer.MDStores(1)   'Database

    Set dsoCube = dsoDB.MDStores(1)     'Cube

    Set dsoPart = dsoCube.MDStores(1)   'Partition

    'MDStores collection of a partition object

    'contains objects of ClassType clsAggregation

    Debug.Print " # Aggregations = " & dsoPart.MDStores.Count

See Also
Using Decision Support Objects MDStore Interface


Collections, clsAggregation

An object of ClassType clsAggregation implements the following collections of the MDStore interface.

Collection | Description
CustomProperties | Collection of user-defined properties.
DataSources | The collection of DataSource objects associated with the aggregation.
Dimensions | The collection of Dimension objects associated with the aggregation.
Measures | The collection of Measure objects associated with the aggregation.


Methods, clsAggregation

An object of ClassType clsAggregation implements the following methods of the MDStore interface.

Method | Description
Clone | Creates a copy of an aggregation object.


Properties, clsAggregation

An object of ClassType clsAggregation implements the following properties of the MDStore interface.

Property | Description
AggregationPrefix | The aggregation prefix.
ClassType | Returns an enumeration constant identifying the specific object type.
Description | The description of the aggregation.
EstimatedRows | The estimated number of rows in the aggregation.
EstimatedSize | The estimated size of all rows in the aggregation (in characters).
FromClause | The comma-separated list of source tables in the aggregation.
IsDefault | Sets or returns True if the aggregation is the default; False if otherwise.
IsTemporary | Indicates whether the aggregation should be persisted in the repository.
IsValid | Returns True if the aggregation structure is valid; False if otherwise.
JoinClause | The list of join conditions, separated by “AND”.
LastProcessed | The date and time when the aggregation was last processed.
Name | The name of the aggregation.
OlapMode | Returns an enumeration constant identifying the type of OLAP mode of the data store.
Parent | Returns a reference to the parent MDStore object.
Server | Returns a reference to the DSO.Server object.
SourceTable | The name of the fact table for the aggregation.
SubClassType | Returns an enumeration constant identifying the subclass type of the object.


clsCollection

A Decision Support Objects (DSO) collection is an object similar to a standard Microsoft® Visual Basic® collection. Unlike typical Visual Basic collections, however, DSO collections can contain only objects of the same type. For example, the Dimensions collection can contain only objects of the object classes that apply to dimensions, such as clsDatabaseDimension, clsCubeDimension, clsPartitionDimension, and clsAggregationDimension.

See Also

Collections


clsCube

An object of ClassType clsCube provides a specific implementation of the MDStore interface of the Decision Support Objects (DSO) library. Each instance of clsCube provides collections, methods, and properties through the MDStore Interface.

Remarks

A cube object is the primary data storage mechanism in Microsoft® SQL Server™ OLAP Services. In general, a cube contains measures, dimensions, and partitions. For more information about the object model hierarchy, see About Decision Support Objects and Interfaces.

A cube object with a SubClassType of sbclsVirtual is a virtual cube. A virtual cube is used to encapsulate a subset of the measures, dimensions, and levels contained in a group of cubes. A virtual cube, like a view in a relational database, is a logical construct that contains no data. Just as a view is a join of multiple relations, a virtual cube is a join of multiple cubes.

The basic model for using virtual cubes is that you add them to a database as a cube with the optional SubClassType parameter set to sbclsVirtual, and then add dimensions and measures to them as needed. However, the dimension and measures are derived from previously defined cubes within the database rather than a dimension table. Any levels associated with a dimension you add to a virtual cube automatically apply to the dimension in the virtual cube. Partitions and aggregations do not apply to virtual cubes.

If you add or remove a dimension or dimension from a virtual cube, you must reprocess the virtual cube for the change to affect the OLAP server operations. The same holds true if you remove a dimension or measure from a cube after assigning it to a virtual cube, or if you remove a dimension or measure from a database after assigning it to a cube or virtual cube.

Example

Use the following code to create an object of ClassType clsCube:

' Assume an object (dsoServer) of ClassType clsServer exists

' and contains a database in its MDStores collection

Dim dsoDB As DSO.MDStore

Dim dsoCube As DSO.MDStore

Set dsoDB = dsoServer.MDStores(1)

Set myCube = dsoDB.MDStores.AddNew("MyCube")

'Set properties and add dimension, levels, and measures

'Create virtual cube

Dim dsoVCube as DSO.MDStore

Set dsoVCube = dsoDB.MDStores.AddNew("MyVCube", sbclsVirtual)

'Add measures, set properties, and add dimension

See Also
Using Decision Support Objects MDStore Interface


Collections, clsCube

An object of ClassType clsCube implements the following collections of the MDStore interface.

Collection | Description
Commands | The collection of Command objects defined in the cube.
CustomProperties | Collection of user-defined properties.
DataSources | The collection of DataSource objects used by the cube.
Dimensions | The collection of Dimension objects defined in the cube.
MDStores | The collection of MDStore objects defined for the cube.
Measures | The collection of Measure objects defined in the cube.
Roles | The collection of Role objects defined for the cube.


Methods, clsCube

An object of ClassType clsCube implements the following methods of the MDStore interface.

Method | Description
Clone | Creates a copy of the property values and optionally collections of major and minor objects.
LockObject | Locks the cube to prevent multiple users from interfering with each other’s work.
Process | Processes the cube.
UnlockObject | Releases a lock previously established by the LockObject method.
Update | Updates the cube’s definition in the metadata repository.


Properties, clsCube

An object of ClassType clsCube implements the following properties of the MDStore interface.

Property | Description
AggregationPrefix | The prefix associated with an aggregation in a cube.
Analyzer | The CubeAnalyzer object for this cube.
ClassType | Returns an enumeration constant identifying the specific object type.
Description | The description of the cube.
EstimatedRows | The estimated number of rows in the cube.
EstimatedSize | The estimated size of the cube (estimated total size of all rows, in bytes).
FromClause | Contains the SQL FROM clause defining the list of tables used to define the cube’s dimensions and measures.
IsTemporary | Indicates whether the cube should be persisted in the repository.
IsValid | Indicates whether the cube structure is valid.
JoinClause | The JOIN clause (list of join conditions, separated by “AND”) for the cube.
LastProcessed | The date and time when the cube was last processed.
LastUpdated | User-specified date. Not used by OLAP Services.
Name | The name of the cube.
OlapMode | Returns an enumeration constant identifying the type of OLAP storage mode.
Parent | Returns a reference to the parent MDStore object.
Server | Returns a reference to the DSO.Server object.
SourceTable | The name of the fact table of the cube.
SourceTableFilter | The SQL statement used to determine which fact table rows are included in the cube.
State | Returns an enumeration constant indicating the difference between the MDStore object referenced by the client application and the corresponding MDStore object on the OLAP server.
SubClassType | Returns an enumeration constant identifying the subclass type.


clsCubeAnalyzer

A Decision Support Objects (DSO) object of ClassType clsCubeAnalyzer contains a single method used to extract information from the query log. The query log stores the descriptions of queries executed on the OLAP server. This object provides a method through its own internal interface.

There are no collections or properties associated with an object of ClassType clsCubeAnalyzer.

See Also
About Decision Support Objects Using Decision Support Objects


Methods, clsCubeAnalyzer

An object of ClassType clsCubeAnalyzer implements the following method.

Method | Description
OpenQueryLogRecordset | Opens a query log recordset.


OpenQueryLogRecordset

The OpenQueryLogRecordset method of an object of ClassType clsCubeAnalyzer returns a Microsoft® ActiveX® Data Objects (ADO DB) recordset containing a record for each OLAP query run on the OLAP server that satisfies the given SQL query.

Syntax

ADODBRecSet = dsoCubeAnalyzer.OpenQueryLogRecordset(SQLString As String)

ADODBRecSet
An ADODB recordset.
dsoCubeAnalyzer
The object of ClassType clsCubeAnalyzer used.
SQLString
The SQL query that returns the desired QueryLogRecordset. You can generate an SQL statement using any of the fields in the query log. For example,

"SELECT * FROM  QueryLog WHERE Duration > 5"

The following columns are returned in ADODBRecSet.

Column | DataType | Description
MSOLAP_Database | Text | The name of the database used in the query.
MSOLAP_Cube | Text | The name of the cube used in the query.
MSOLAP_User | Text | The name of the user that ran the query.
Dataset | Text | A numeric string indicating the level from each dimension used to satisfy the query.
StartTime | Data/Time | The time the query began.
Duration | Number | The length of time (in seconds) of the query execution.
MOLAPPartitions | Number | The number of aggregations used to satisfy the query.
ROLAPPartitions | Number | The number of aggregations used to satisfy the query.
SamplingRate | Number | The sampling rate at the time the query was executed.

Remarks

In order to create an instance of the ADODB Recordset object, you must add the ActiveX Data Objects reference to your Microsoft Visual Basic® project.

See Also

Using Decision Support Objects


clsCubeCommand

An object of ClassType clsCubeCommand provides a specific implementation of the Decision Support Objects (DSO) Command interface. This object provides collections and properties through the Command interface. There are no methods associated with an object of ClassType clsCubeCommand.

Remarks

A clsCubeCommand object encapsulates a user-defined command automatically executed on the Microsoft® SQL Server™ OLAP Services client when the cube containing the command is accessed. You add a command to a cube by adding it to the cube’s Commands collection. Such commands include calculated members, named sets, library references, and others.

For more information, see About Decision Support Objects.

Example

Use the following code to create an object of ClassType clsCubeCommand:

'Assume an object (dsoServer) of ClassType clsServer exists

'with existing database and cube

Dim dsoDB As DSO.MDStore        'Database

Dim dsoCube As DSO.MDStore    'Cube

Dim dsoCmd As DSO.Command    'Command

Set dsoDB = dsoServer.MDStores(1)

Set dsoCube = dsoDB.MDStores(1)

Set dsoCmd = dsoCube.Commands.AddNew("CubeCmd1")


Collections, clsCubeCommand

An object of ClassType clsCubeCommand implements the following collections of the Command interface.

Collection | Description
CustomProperties | Collection of user-defined properties.


Properties, clsCubeCommand

An object of ClassType clsCubeCommand implements the following properties of the Command interface.

Property | Description
ClassType | Returns an enumeration constant identifying the specific object type.
CommandType | Returns an enumeration constant identifying the specific command option.
Description | The description of the cube command.
IsValid | Indicates whether or not the Name and Statement properties are not empty strings, as well as whether the cube command object belongs to a collection.
Name | The name of the cube command.
OrdinalPosition | Returns the ordinal position of the command object in the parent MDStore object’s Commands collection.
Parent | Returns a reference to the parent MDStore object.
Statement | The text of the cube command statement (MDX statement).
SubClassType | Returns an enumeration constant identifying the subclass type of the object.


clsCubeDimension

An object of ClassType clsCubeDimension provides a specific implementation of the Decision Support Objects (DSO) Dimension interface. This object provides collections and properties through the Dimension interface. There are no methods associated with an object of ClassType clsCubeDimension.

Remarks

To define a cube dimension, you add a reference to an existing dimension within a database to the cube’s Dimensions collection. A shared database dimension can be associated with multiple cube dimensions; a private database dimension can be associated with only one cube dimension. In both cases, the database dimension is automatically associated with the cube’s partitions and aggregations, if there are any. For more information, see Dimension Interface and About Decision Support Objects.

Example

Use the following code to create a clsCubeDimension object:

'Assume an object (dsoServer) of ClassType clsServer exists

'with an existing database and cube

Dim dsoDB As MDStore

Dim dsoCube As MDStore

Dim dsoCubeDim As DSO.Dimension

Set dsoDB = dsoServer.MDStores(1)

Set dsoCube = dsoDB.MDStores(1)

'"Dim 1" is an existing database dimension

Set dsoCubeDim = dsoCube.Dimensions.AddNew("Dim 1")

See Also
About Decision Support Objects | Dimension Interface
Using Decision Support Objects |


Collections, clsCubeDimension

An object of ClassType clsCubeDimension implements the following collections of the Dimension interface.

Collection | Description
CustomProperties | Collection of user-defined properties.
Levels | The collection of Level objects associated with the cube dimension.


Properties, clsCubeDimension

An object of ClassType clsCubeDimension implements the following properties of the Dimension interface.

Property | Description
ClassType | Returns an enumeration constant identifying the specific object type.
DataSource | The name of the DataSource object used by the cube dimension.
Description | The description of the cube dimension.
DimensionType | Returns an enumeration constant identifying the specific type of dimension.
FromClause | The SQL FROM clause for the cube dimension.
IsShared | Indicates whether the cube dimension is shared.
IsValid | Indicates whether the structure of the cube dimension is valid.
JoinClause | The SQL JOIN clause for a cube dimension.
LastProcessed | The date and time when the cube dimension was last processed.
LastUpdated | User-specified date. Not used by OLAP Services.
Name | The name of the cube dimension.
OrdinalPosition | Returns the ordinal position of the dimension object within its parent object’s Dimensions collection.
Parent | Returns a reference to the parent MDStore object.
SourceTable | The name of the cube dimension’s primary data source table.
SubClassType | Returns an enumeration constant identifying the subclass type of the object.


clsCubeLevel

An object of ClassType clsCubeLevel provides a specific implementation of the Decision Support Objects (DSO) Level interface. This object provides collections and properties through the Level interface. There are no methods associated with an object of ClassType clsCubeLevel.

Remarks

When a dimension within a database is assigned to a cube, the cube inherits all levels of the dimension. An object of ClassType clsCubeLevel allows access to these levels. One advantage of accessing a cube's levels is to avoid traversing the dimensions and levels in the database (not all database dimensions necessarily apply to a given cube) to determine which levels are used in aggregations for a cube's partition. Also, some properties such as IsDisabled may only be set for a cube level object.

For more information, see Level Interface and About Decision Support Objects.

Example

Use the following code to create dimension and levels for a database and apply them to a cube.

'Assume an object (dsoDB) of ClassType clsDatabase exists

'with an existing datasource

Dim dsoDim As DSO.Dimension

Dim dsoLevel As DSO.Level

Dim dsoDS As DSO.Datasource

'Add a dimension and levels to the database

Set dsoDS = dsoDB.Datasources(1)

Set dsoDim = dsoDB.Dimensions.AddNew("Products")

Set dsoDim.DataSource = dsoDS   'Dimension DataSource

dsoDim.FromClause = "product"   'Source Table

'Product Brand Level

Set dsoLev = dsoDim.Levels.AddNew("Brand Name")

dsoLev.MemberKeyColumn = """product"".""brand_name"""

dsoLev.ColumnSize = 255

dsoLev.ColumnType = adWChar

dsoLev.EstimatedSize = 100

'Product Name Level

Set dsoLev = dsoDim.Levels.AddNew("Product Name")

dsoLev.MemberKeyColumn = """product"".""product_name"""

dsoLev.ColumnSize = 255

dsoLev.ColumnType = adWChar

dsoLev.EstimatedSize = 1560

dsoDim.Update

'Add additional dimensions and levels as required

...

'Add cube to database

Dim dsoCube As MDStore

Set dsoCube = dsoDB.MDStores.AddNew(strCubeName)

'Set the cube's DataSource

Set dsoDS = dsoDB.DataSources(1)

dsoCube.DataSources.AddNew (dsoDS.Name)

'Set source Fact Table and Estimated Rows in Fact Table

dsoCube.SourceTable = """sales_fact_1998"""

dsoCube.EstimatedRows = 1000

'Add shared database dimensions

'Cube inherits dimension levels

dsoCube.Dimensions.AddNew ("Products")

'Add other shared or private dimensions


Collections, clsCubeLevel

An object of ClassType clsCubeLevel implements the following collections of the Level interface.

Collection | Description
CustomProperties | Collection of user-defined properties.


Properties, clsCubeLevel

An object of ClassType clsCubeLevel implements the following properties of the Level interface.

Property | Description
ClassType | Returns an enumeration constant identifying the specific object type.
ColumnSize | The size of the MemberKeyColumn of the cube level.
ColumnType | The data type of the MemberKeyColumn of the cube level.
Description | The description of the cube level.
EstimatedSize | The estimated number of rows in the cube level.
FromClause | Contains the SQL FROM clause for the cube level.
IsDisabled | Indicates whether the cube level is disabled.
IsUnique | Indicates whether the members of the cube level are unique.
IsValid | Indicates whether the structure of the cube level is valid.
JoinClause | The SQL JOIN clause of the cube level.
LevelType | Returns an enumeration constant identifying the specific type of level.
MemberKeyColumn | The name of the column that contains the member key of the cube level.
MemberNameColumn | The name of the column that contains member names.
Name | The name of the cube level.
OrdinalPosition | Returns the ordinal position of the level in the parent object’s Levels collection.
Parent | Returns a reference to the parent Dimension object.
SubClassType | Returns an enumeration constant identifying the subclass type of the object.


clsCubeMeasure

An object of the ClassType clsCubeMeasure provides a specific implementation of the Decision Support Objects (DSO) Measure interface. This object provides collections and properties through the Measure interface. There are no methods associated with an object of ClassType clsCubeMeasure.

Remarks

A cube measure corresponds to a numerically-valued column in a cube’s fact table. When a cube is processed, its measures can be aggregated across its dimensions. For example, the number of items sold is a measure that can be aggregated across the dimensions of product, time, and geography.

For more information about the object model hierarchy, see About Decision Support Objects.

Example

Use the following code to create an object of ClassType clsCubeMeasure.

'Assume an object (dsoCube) of ClassType clsCube exists

Dim dsoMeasure As DSO.Measure

Set dsoMeasure = dsoCube.Measures.AddNew("MyCubeMeasure")

See Also

Add a Cube


Collections, clsCubeMeasure

An object of ClassType clsCubeMeasure implements the following collections of the Measure interface.

Collection | Description
CustomProperties | Collection of user-defined properties.


Properties, clsCubeMeasure

An object of ClassType clsCubeMeasure implements the following properties of the Measure interface.

Property | Description
AggregateFunction | A value corresponding to the type of aggregation function used by the cube measure.
ClassType | Returns an enumeration constant identifying the specific object type.
Description | The description of the cube measure.
FormatString | The format used to display the values of the cube measure.
IsInternal | Indicates whether the cube measure is internal (used only for calculations of other measures).
IsValid | Indicates whether the measure structure is valid.
Name | The name of the cube measure.
OrdinalPosition | Returns the ordinal position of the measure in the parent object’s Measures collection.
Parent | Returns a reference to the parent MDStore object.
SourceColumn | The name of the source column (in the fact table) for the cube measure.
SourceColumnType | Returns an ADO DB enumeration constant identifying the SourceColumn (in the fact table) data type.
SubClassType | Returns an enumeration constant identifying the subclass type of the object.


clsCubeRole

An object of the ClassType clsCubeRole provides a specific implementation of the Decision Support Objects (DSO) Role interface. This object provides collections, methods, and properties through the Role interface.

Remarks

clsCubeRole objects are used to manage the set of users who can access a cube and the manner in which they can access it. A cube role has a name, a description, a parent object, a class type, a list of users, and a set of permissions. Each permission has a key and a corresponding permission expression. Cube roles can be used with virtual cubes and regular cubes.

You create roles at the database level (database roles) and then assign them to cubes (cube roles) by adding them to the collection of roles associated with the cube. The roles assigned to a cube automatically apply to its partitions and aggregations.

You can remove a database role by removing it from the database’s collection of role objects. When you do so, the system automatically removes the corresponding cube roles from the cube’s collection of role objects.

You can remove a cube role by removing it from the cube’s collection of role objects. When you do so, the corresponding database role is not affected. However, the definition of the cube role remains in effect until you update or process the cube.

Example

Suppose you want to define roles called “finance-managers,” “production-managers,” and “sales-managers” at the database level. Suppose also that you want to assign the appropriate vice-president to the list of users for each role and the company president to the list of users for all three roles. Finally, suppose that you want to create a cube for each year's financial, production, and sales data for the years 1995, 1996, and 1997.

Use the following code to define the appropriate database and cube roles for this situation.

Note User lists defined for database roles are automatically associated with the corresponding cube roles and cannot be changed at the cube role level.

'Assume an object (dsoDB) of ClassType clsDatabase exists

'Create database roles

Dim DbRole_FinanceMgrs As DSO.Role

Dim DbRole_ProductionMgrs As DSO.Role

Dim DbRole_SalesMgrs As DSO.Role

Set DbRole_FinanceMgrs = dsoDB.Roles.AddNew("FinanceManagers")

Set DbRole_ProductionMgrs = dsoDB.Roles.AddNew("ProductionManagers")

Set SbRole_SalesMgrs = dsoDB.Roles.AddNew("SalesManagers")

'Define user lists for database roles

'(In a real-world situation, actual user names would be

'used in place of titles like "President".)

DbRole_FinanceMgrs.UsersList = "President,VP_Finance"

DbRole_ProductionMgrs.UsersList = "President,VP_Production"

DbRole_SalesMgrs.UsersList = "President,VP_Sales"

'Update the repository for the database roles

DbRole_FinanceMgrs.Update

DbRole_ProductionMgrs.Update

DbRole_SalesMgrs.Update

'Assume objects (Cube95, Cube96 and Cube97) of ClassType clsCube exist

'Create cube roles. Cube role names must be identical

'to the corresponding database role names.

Dim CubeRole_FinanceMgrs As DSO.Role

Dim CubeRole_ProductionMgrs As DSO.Role

Dim CubeRole_SalesMgrs As DSO.Role

'Add Roles to Cube95

Set CubeRole_FinanceMgrs = Cube95.Roles.AddNew("FinanceManagers")

Set CubeRole_ProductionMgrs = Cube95.Roles.AddNew("ProductionManagers")

Set CubeRole_SalesMgrs = Cube95.Roles.AddNew("SalesManagers")

'Add Roles to Cube96

Set CubeRole_FinanceMgrs = Cube96.Roles.AddNew("FinanceManagers")

Set CubeRole_ProductionMgrs = Cube96.Roles.AddNew("ProductionManagers")

Set CubeRole_SalesMgrs = Cube96.Roles.AddNew("SalesManagers")

'Add Roles to Cube97

Set CubeRole_FinanceMgrs = Cube97.Roles.AddNew("FinanceManagers")

Set CubeRole_ProductionMgrs = Cube97.Roles.AddNew("ProductionManagers")

Set CubeRole_SalesMgrs = Cube97.Roles.AddNew("SalesManagers")

'Update the repository for the cubes

Cube95.Update

Cube96.Update

Cube97.Update

See Also
clsDatabaseRole Role Interface


Collections, clsCubeRole

An object of ClassType clsCubeRole implements the following collections of the Role interface.

Collection | Description
CustomProperties | Collection of user-defined properties.


Methods, clsCubeRole

An object of ClassType clsCubeRole implements the following methods of the Role interface.

Method | Description
SetPermissions | Sets the permissions for a cube role for a given key.


Properties, clsCubeRole

An object of ClassType clsCubeRole implements the following properties of the Role interface.

Property | Description
ClassType | Returns an enumeration constant identifying the specific object type.
Description | The description of a cube role.
IsValid | Indicates whether a role structure is valid.
Name | The name of a cube role.
Parent | Returns a reference to the parent MDStore object.
Permissions | The permissions for a cube role for a given key.
SubClassType | Returns an enumeration constant identifying the subclass type of the object.
UsersList | A semicolon-separated list of users of a cube role.


clsDatabase

An object of the ClassType clsDatabase provides a specific implementation of the Decision Support Objects (DSO) MDStore interface. This object provides collections, methods, and properties through the MDStore interface.

Remarks

In general, a database contains cubes, which in turn contain partitions, which may in turn contain dimensions, levels, measures, and aggregations. A database may also contain virtual cubes.

For more information about the object model hierarchy, see About Decision Support Objects and Interfaces.

Example

Use the following code to create an object of ClassType clsDatabase:

' Assume an object (dsoServer) of ClassType clsServer exists

Dim dsoDatabase As DSO.MDStore

Set dsoDatabase = dsoServer.MDStores.AddNew("MyDatabase")

See Also
Using Decision Support Objects MDStore Interface


Collections, clsDatabase

An object of ClassType clsDatabase implements the following collections of the MDStore interface.

Collection | Description
Commands | The collection of Command objects defined in the database.
CustomProperties | Collection of user-defined properties.
DataSources | The collection of DataSource objects used by the database.
Dimensions | The collection of Dimension objects defined in the database.
MDStores | The collection of MDStore objects defined for the database.
Roles | The collection of Role objects defined for the database.


Methods, clsDatabase

An object of ClassType clsDatabase implements the following methods of the MDStore interface.

Method | Description
BeginTrans | Begins the transaction on the database.
Clone | Creates a copy of the property values and optionally collections of major and minor objects.
CommitTrans | Commits the transaction on the database.
LockObject | Locks the database to prevent multiple users from interfering with each other’s work.
Process | Processes the database.
Rollback | Rolls back the transaction on the database.
UnlockObject | Releases a lock previously established by the LockObject method.
Update | Updates the database definition in the metadata repository.


Properties, clsDatabase

An object of ClassType clsDatabase implements the following properties of the MDStore interface.

Property | Description
AggregationPrefix | The prefix associated with an aggregation in the database.
ClassType | Returns an enumeration constant identifying the specific object type.
Description | The description of the database.
IsValid | Indicates whether the structure of the database is valid.
LastUpdated | User-specified date. Not used by OLAP Services.
Name | The name of the database.
OlapMode | Returns an enumeration constant identifying the type of OLAP storage mode.
Parent | Returns a reference to the parent server object.
Server | Returns a reference to the DSO.Server object.
State | Returns an enumeration constant indicating the difference between the database object referenced by the client application and corresponding database on the OLAP server.
SubClassType | Returns an enumeration constant identifying the subclass type.


clsDatabaseCommand

An object of ClassType clsDatabaseCommand provides a specific implementation of the Decision Support Objects (DSO) Command interface. This object provides collections, methods, and properties through the Command interface.

Remarks

A clsDatabaseCommand object encapsulates a user-defined command that is automatically executed on the Microsoft® SQL Server™ OLAP Services client when the database containing the command is accessed. You add a command to a database by adding it to the database’s Commands collection. Such commands include calculated members, named sets, library references, and others.

For more information, see About Decision Support Objects.

Example

Use the following code to create an object of ClassType clsDatabaseCommand:

'Assume an object (dsoServer) of ClassType clsServer exists

'with an existing database

Dim dsoDB As DSO.MDStore        'Database

Dim dsoCmd As DSO.Command    'Command

Set dsoDB = dsoServer.MDStores(1)

Set dsoCmd = dsoCube.Commands.AddNew("DBCmd1")


Collections, clsDatabaseCommand

An object of ClassType clsDatabaseCommand implements the following collections of the Command interface.

Collection | Description
CustomProperties | Collection of user-defined properties.


Methods, clsDatabaseCommand

An object of ClassType clsDatabaseCommand implements the following methods of the Command interface.

Method | Description
Clone | Copies an existing object to a target object of the same class type.
LockObject | Locks an object.
UnlockObject | Unlocks a previously locked object.
Update | Updates the database command's definition in the metadata repository.


Properties, clsDatabaseCommand

An object of ClassType clsDatabaseCommand implements the following properties of the Command interface.

Property | Description
ClassType | Returns an enumeration constant identifying the specific class type.
CommandType | Returns an enumeration constant identifying the command option.
Description | The description of the database command.
IsValid | Indicates whether or not the Name and Statement properties are not empty strings, as well as whether the command object belongs to a collection.
Name | The name of the database command.
OrdinalPosition | Returns the ordinal position of the command object in the parent MDStore object’s Commands collection.
Parent | Returns a reference to the parent MDStore object.
Statement | The text of the database command statement (MDX statement).
SubClassType | Returns an enumeration constant identifying the subclass type of the object.


clsDatabaseDimension

An object of ClassType clsDatabaseDimension provides a specific implementation of the Decision Support Objects (DSO) Dimension interface. This object provides collections, methods, and properties through the Dimension interface.

Remarks

Database dimensions can be shared or private. A shared database dimension can be associated with any number of cubes, but a private database dimension can be associated with one only cube. When a database dimension is associated with a cube, it is automatically associated with the cube’s partitions and aggregations, if there are any.

All dimensions, shared and private, are created in a database object and stored in the database object’s Dimensions collection. Private dimensions are identified by incorporating the names of the cubes to which they are private into the names of the dimensions. For example, a dimension named “Cube1^PrivateDimension” is private to Cube1 because its name begins with “Cube1” followed by the caret (^) character.

For more information, see Dimension Interface and About Decision Support Objects.

Example

Use the following code to create a DatabaseDimension object:

' Assume an object (dsoDB) of ClassType clsDatabase exists

Dim dsoDim As DSO.Dimension

Set dsoDim = dsoDB.Dimensions.AddNew("MyDim")

See Also
About Decision Support Objects | Dimension Interface
Using Decision Support Objects |


Collections, clsDatabaseDimension

An object of ClassType clsDatabaseDimension implements the following collections of the Dimension interface.

Collection | Description
CustomProperties | Collection of user-defined properties.
Levels | The collection of Level objects associated with the database dimension.


Methods, clsDatabaseDimension

An object of ClassType clsDatabaseDimension implements the following methods of the Dimension interface.

Method | Description
Clone | Creates a copy of the database dimension.
LockObject | Locks the database dimension.
Process | Processes the database dimension.
UnlockObject | Unlocks the previously locked database dimension.
Update | Updates the definition of the database dimension in the metadata repository.


Properties, clsDatabaseDimension

An object of ClassType clsDatabaseDimension implements the following properties of the Dimension interface.

Property | Description
ClassType | Returns an enumeration constant identifying the specific object type.
DataSource | The name of the DataSource object used by the database dimension.
Description | The description of the database dimension.
DimensionType | Returns an enumeration constant identifying the specific type of dimension.
FromClause | The SQL FROM clause for a database dimension.
IsShared | Indicates whether the database dimension is shared.
IsTemporary | Indicates whether the database dimension should be persisted in the repository.
IsValid | Indicates whether the structure of the database dimension is valid.
JoinClause | The SQL JOIN clause for the dimension.
LastProcessed | The date and time when the database dimension was last processed.
LastUpdated | User-specified date. Not used by OLAP Services.
Name | The name of the database dimension.
OrdinalPosition | Returns the ordinal position of the dimension object within its parent object’s Dimensions collection.
Parent | Returns a reference to the parent MDStore object.
SourceTable | The name of the primary table of the database dimension.
SubClassType | Returns an enumeration constant identifying the subclass type of the object.


clsDatabaseLevel

An object of ClassType clsDatabaseLevel provides a specific implementation of the Decision Support Objects (DSO) Level interface. This object provides collections and properties through the Level interface. There are no methods associated with an object of ClassType clsDatabaseLevel.

Remarks

When you add a dimension to a cube, it inherits whatever levels you defined for the database dimension; that is, the database levels you defined become cube levels as well. Similarly, database levels are automatically inherited by the partitions and aggregations you add to a cube. You can add and remove database levels at any time, but you must process the database dimensions and then process all cubes and virtual cubes that use any of the dimensions you changed.

For more information, see Level Interface and About Decision Support Objects.

Example

Use the following code to create a clsDatabaseLevel object:

' Assume the existence of an object (myDim) of ClassType clsDimension

Dim myLev As DSO.Level

Set myLev = myDim.Levels.AddNew("Brand Name")


Collections, clsDatabaseLevel

An object of ClassType clsDatabaseLevel implements the following collections of the Level interface.

Collection | Description
CustomProperties | Collection of user-defined properties.


Properties, clsDatabaseLevel

An object of ClassType clsDatabaseLevel implements the following properties of the Level interface.

Property | Description
ClassType | Returns an enumeration constant identifying the specific object type.
ColumnSize | The size of the MemberKeyColumn of the level.
ColumnType | The data type of the MemberKeyColumn of the level.
Description | The description of the database level.
EstimatedSize | The estimated number of rows in the database level.
FromClause | The SQL FROM clause for the database level.
IsUnique | Indicates whether the database level’s members are unique.
IsValid | Indicates whether the structure of the database level is valid.
JoinClause | The SQL JOIN clause for the database level.
LevelType | Returns an enumeration constant identifying the specific type of level.
MemberKeyColumn | The name of the column that contains the member keys of the database level.
MemberNameColumn | The name of the column that contains member names.
Name | The name of the database level.
OrdinalPosition | Returns the ordinal position of the level in the parent object’s Levels collection.
Parent | Returns a reference to the parent Dimension object.
SubClassType | Returns an enumeration constant identifying the subclass type of the object.


clsDatabaseRole

An object of ClassType clsDatabaseRole provides a specific implementation of the Decision Support Objects (DSO) Role interface. This object provides collections, methods, and properties through the Role interface.

Remarks

Objects of ClassType clsDatabaseRole are used to manage the set of users who can access a database and the manner in which they can access it. A database role has a name, a description, a parent object, a class type, a list of users, and a set of permissions. Each permission has a key and a corresponding permission expression.

You create roles at the database level (database roles) and then assign them to cubes (cube roles) by adding them to the collection of roles associated with the cube. The roles assigned to a cube automatically apply to its partitions and aggregations.

You can remove a database role by removing it from the database’s collection of role objects. When you do so, the system automatically removes the corresponding cube roles from the cube’s collection of role objects.

Example

Suppose you define roles called “finance-managers,” “production-managers,” and “sales-managers” at the database level. Suppose also that you assign the appropriate vice-president to the list of users for each role and the company president to the list of users for all three roles.

Use the following code to define the appropriate database and cube roles for this situation. Once the code has been executed, you can assign the database roles to cubes (or virtual cubes) as needed. For more information, see clsCubeRole.

'Assume an object (dsoDB) of ClassType clsDatabase exists

'Create database roles

Dim DbRole_FinanceMgrs As DSO.Role

Dim DbRole_ProductionMgrs As DSO.Role

Dim DbRole_SalesMgrs As DSO.Role

Set DbRole_FinanceMgrs = dsoDB.Roles.AddNew("FinanceManagers")

Set DbRole_ProductionMgrs = dsoDB.Roles.AddNew("ProductionManagers")

Set SbRole_SalesMgrs = dsoDB.Roles.AddNew("SalesManagers")

'Define user lists for database roles

'(In a real-world situation, actual user names would be

'used in place of titles like "President".)

DbRole_FinanceMgrs.UsersList = "President,VP_Finance"

DbRole_ProductionMgrs.UsersList = "President,VP_Production"

DbRole_SalesMgrs.UsersList = "President,VP_Sales"

'Update the repository for the database roles

DbRole_FinanceMgrs.Update

DbRole_ProductionMgrs.Update

DbRole_SalesMgrs.Update

'Assume objects (Cube95, Cube96 and Cube97) of ClassType clsCube exist

'Create cube roles. Cube role names must be identical

'to the corresponding database role names.

Dim CubeRole_FinanceMgrs As DSO.Role

Dim CubeRole_ProductionMgrs As DSO.Role

Dim CubeRole_SalesMgrs As DSO.Role

'Add Roles to Cube95

Set CubeRole_FinanceMgrs = Cube95.Roles.AddNew("FinanceManagers")

Set CubeRole_ProductionMgrs = Cube95.Roles.AddNew("ProductionManagers")

Set CubeRole_SalesMgrs = Cube95.Roles.AddNew("SalesManagers")

'Add Roles to Cube96

Set CubeRole_FinanceMgrs = Cube96.Roles.AddNew("FinanceManagers")

Set CubeRole_ProductionMgrs = Cube96.Roles.AddNew("ProductionManagers")

Set CubeRole_SalesMgrs = Cube96.Roles.AddNew("SalesManagers")

'Add Roles to Cube97

Set CubeRole_FinanceMgrs = Cube97.Roles.AddNew("FinanceManagers")

Set CubeRole_ProductionMgrs = Cube97.Roles.AddNew("ProductionManagers")

Set CubeRole_SalesMgrs = Cube97.Roles.AddNew("SalesManagers")

'Update the repository for the cubes

Cube95.Update

Cube96.Update

Cube97.Update

See Also
clsCubeRole Role Interface


Collections, clsDatabaseRole

An object of ClassType clsDatabaseRole implements the following collections of the Role interface.

Collection | Description
CustomProperties | Collection of user-defined properties.


Methods, clsDatabaseRole

An object of ClassType clsDatabaseRole implements the following methods of the Role interface.

Method | Description
Clone | Creates a copy of a database role.
LockObject | Locks the role object.
UnlockObject | Unlocks a previously locked object.
Update | Updates the definition of the database role in the metadata repository.


Properties, clsDatabaseRole

An object of ClassType clsDatabaseRole implements the following properties of the Role interface.

Property | Description
ClassType | Returns an enumeration constant identifying the specific object type.
Description | The description of a database role.
IsValid | Indicates whether the role structure is valid.
Name | The name of a database role.
Parent | Returns a reference to the parent MDStore object.
SubClassType | Returns an enumeration constant identifying the subclass type of the object.
UsersList | A semicolon-separated list of users of the database role.


clsDatasource

An object of ClassType clsDatasource specifies an external database that will be used as a source of data for an object of ClassType clsDatabase, clsCube, or clsPartition. The object of ClassType clsDatasource object provides collections, methods, and properties though its own internal interface.

Remarks

Connections to data sources are initiated when Decision Support Objects (DSO) requires access to data or property information in the source database. Data sources are only connected to when needed or when explicitly requested by the program. Executing the IsConnected method of an object of ClassType clsDatasource causes the OLAP server to attempt to connect to the specified data source.

An object of ClassType clsDatabase may contain multiple objects of ClassType clsDatasource in its DataSources collection. Objects of ClassType clsCube and clsPartition can only contain a single object of ClassType clsDatasource in their respective Datasources collection. An aggregation object (ClassType clsAggregation) does not implement the DataSources collection of the MDStore interface.

See Also
About Decision Support Objects Using Decision Support Objects


Collections, clsDatasource

An object of ClassType clsDatasource implements the following collection.

Collection | Description
CustomProperties | Collection of user-defined properties.

Access

Read/write


Methods, clsDatasource

An object of ClassType clsDatasource implements the following methods.

Method | Description
Clone | Copies a clsDatasource object to another clsDatasource object.
IsConnected | Connects to a data source. Returns True if connected; False if unable to connect.
LockObject | Locks a clsDatasource object.
UnlockObject | Unlocks a previously locked clsDatasource object.
Update | Updates the clsDatasource object definition in the metadata repository.


Clone

The Clone method of an object of ClassType clsDatasource copies the property values and the collections of a DataSource object to a target object of the same class type.

Applies To
clsDatasource

Syntax

object.Clone(TargetObject [, CloneOptions])

object
The object of ClassType clsDatasource object to be copied.
TargetObject
An existing object of ClassType clsDatasource.
CloneOptions
A member of the CloneOptions enumeration that specifies the options to tell the method the extent to which the source object should be copied. Because objects of ClassType clsDatasource contain no major or minor objects, the entire object is cloned regardless of the option specified - you should omit the optional CloneOptions argument, or specify cloneObjectProperties.


IsConnected

The IsConnected method of an object of ClassType clsDatasource verifies the connection to the data source specified by the ConnectionString property. If the data source is not connected, the method attempts to connect to the source.

Syntax

bRet = objDS.IsConnected(Error)

bRet
A Boolean variable that receives the returned value: True is returned if the data source is connected; False if the connection cannot be established.
objDS
An object of ClassType clsDatasource.
Error
An optional string variable that receives the error definition if the connection cannot be established.
Remarks

If the data source is already connected when the method is executed, the method returns True. If the data source is not connected, the method attempts to connect to the data source, returning True if the connection is established or False if the connection cannot be established.

It is not necessary to establish a connection to a data source before it can be used. Decision Support Objects (DSO) will automatically establish the connection when necessary, such as to read a property value from the source database or to access data in the database.

Example

'Assume an object (dsoDS) of ClassType clsDatasource exists

If Not dsoDS.IsConnected Then

   ' Code to handle connection error

Else

   ' Connection is established

End If


LockObject

The LockObject method of an object of ClassType clsDatasource locks a DataSource object to prevent actions of multiple users of the object from colliding.

Applies To
clsDatasource

Syntax

object.LockObject(LockType, LockDescription)

object
The object to lock.
LockType
One of the lock types of the OlapLockTypes enumeration.
LockDescription
A string containing the description of the lock, available to other applications attempting to obtain a lock.
Remarks

For a complete discussion of object locking, see the LockObject method in MDStore Interface.


UnlockObject

The UnlockObject method of an object of ClassType clsDatasource releases a lock on a DataSource object previously established by the LockObject method.

Applies To
clsDatasource

Syntax

object.UnlockObject

object
The object from which to remove a lock.
Remarks

For a complete discussion of object locking, see the LockObject method in MDStore Interface.


Update

The Update method of an object of ClassType clsDatasource updates the definition of a DataSource object in the metadata repository.

Syntax

object.Update

object
An object of ClassType clsDatasource.


Properties, clsDatasource

An object of ClassType clsDatasource implements the following properties. The table also shows whether the property is read/write (R/W) or read-only (R).

Property | Description | Access
ClassType | Returns an enumeration constant identifying the specific class type. | R
CloseQuoteChar | The right (closing) quote character used by the source database. | R
Connection | A reference to a Microsoft® ActiveX® Data Objects (ADO) Connection object, used to connect to a relational database. | R
ConnectionString | A string containing the initialization parameters for the source database. | R/W
Description | A description of the data source. | R/W
IsReadOnly | Indicates whether the data source is read-only. | R
IsValid | Indicates whether the structure of the data source object is valid. | R
Name | The name of the data source object. | R/W (read-only after the object has been named)
OpenQuoteChar | The left (opening) quote character used by the source database. | R
Parent | Returns a reference to the parent MDStore object. | R/W
SubClassType | Returns an enumeration constant identifying the subclass type of the object. | R
SupportedTxnDDL | Returns the value of the connection object’s Transaction DDL (data definition language) property, which indicates the source database’s ability to support DDL statements in transactions. | R


ClassType

The ClassType property of a DataSource object returns an enumeration constant identifying the specific class type.

Data Type

ClassTypes (an enumeration)

Access

Read-only

Values

clsDatasource for all data source objects.

Remarks

For a complete lists of class types, see Enumerations.

See Also

SubClassType


CloseQuoteChar

The CloseQuoteChar property of an object of ClassType clsDatasource returns the right (closing) quote character used by the source database.

Data Type

Variant

Access

Read-only

Value

Determined by the source database.

Remarks

To properly qualify a table or column name that contains white space, a data source may require the name be delimited or enclosed using a quote character. The quote character is generally specific to the data source or data source driver.

Example

Use the following code to specify a FromClause in a dimension.

'Assume an object (dsoDimension) of

'ClassType clsDatabaseDimension exists and

'get the quoting characters from the datasource

Dim sLQuote As String, sRQuote As String

sLQuote = dsoDimension.Datasource.OpenQuoteChar

sRQuote = dsoDimension.Datasource.CloseQuoteChar

'Set the dimension type

dsoDimension.DimensionType = dimRegular

'Set the comma separated list of the dimension tables

dsoDimension.FromClause = sLQuote & "store" & sRQuote


Connection

The Connection property of an object of ClassType clsDatasource returns a reference to a Microsoft® ActiveX® Data Objects (ADO) Connection object, used to connect to a relational database.

Data Type

ADODB.Connection object

Access

Read-only

Remarks

You can use this ADO Connection object to access the source database directly. For more information, see the ADO documentation.


ConnectionString

The ConnectionString property of an object of ClassType clsDatasource returns a string containing the OLE DB initialization parameters for the source database.

Data Type

String (OLE DB connection string)

Access

Read/write

Remarks

For more information about valid connection string parameters and format, see the OLE DB documentation or the source database documentation.

Example

'Assume an object (dsoDatasource) of ClassType clsDatasource exists

'Set the OleDB connection string.

'The connection string is used to establish the connection

'to the relational database that contains the dimension and

'fact tables. We will use OleDB provider for ODBC drivers

dsoDatasource.ConnectionString = _

    "Provider=MSDASQL.1;Data Source=FoodMart;Connect Timeout=15"

'Save the datasource definition in the metadata repository

 dsoDatasource.Update


Description

The Description property of an object of ClassType clsDatasource sets or returns the description of the data source.

Data Type

String

Values

Maximum length is 255 characters.

Access

Read/write

Remarks

You can use this property to provide a description of the data source. For example, “1997 Sales Data verified 2/1/1998.”


IsReadOnly

The IsReadOnly property of an object of ClassType clsDatasource identifies whether the source database is read-only.

Data Type

Boolean

Values

True if the source database is read-only; False if otherwise.

Access

Read-only


IsValid

The IsValid property of an object of ClassType clsDatasource identifies whether the structure of an object is valid.

Data Type

Boolean

Values

True if the structure of the object is valid; False if otherwise.

Access

Read-only

Remarks

Validity checking consists of verifying that the object’s Name, Parent, and ConnectionString properties are not empty.


Name

The Name property of an object of ClassType clsDatasource sets or returns the name of the object.

Data Type

String

Values

A valid Decision Support Objects (DSO) name. Maximum length is 50 characters.

Access

Read/write (read-only after the object has been named)


OpenQuoteChar

The OpenQuoteChar property of an object of ClassType clsDatasource contains the left (opening) quote character used by the source database.

Data Type

Variant

Access

Read-only

Value

Determined by the source database.

Remarks

To properly qualify a table or column name that contains white space, a data source may require the name be delimited or enclosed using a quote character. The quote character is generally specific to the data source or data source driver.

Example

Use the following code to specify a FromClause in a dimension.

'Assume an object (dsoDimension) of

'ClassType clsDatabaseDimension exists and

'get the quoting characters from the datasource

Dim sLQuote As String, sRQuote As String

sLQuote = dsoDimension.Datasource.OpenQuoteChar

sRQuote = dsoDimension.Datasource.CloseQuoteChar

'Set the dimension type

dsoDimension.DimensionType = dimRegular

'Set the comma separated list of the dimension tables

dsoDimension.FromClause = sLQuote & "store" & sRQuote


Parent

The Parent property of an object of ClassType clsDatasource contains a reference to the parent MDStore object that contains the DataSource object. For more information about MDStore objects, see MDStore Interface.

Data Type

MDStore

Access

Read-write

Remarks

You can only set this property to an object of ClassType clsDatabase. Attempting to set this property to an object of any other class type returns an error.


SubClassType

The SubClassType property of an object of ClassType clsDatasource contains an enumeration constant identifying the subclass type of the object.

Data Type

SubClassTypes (an enumeration)

Access

Read-only

Remarks

For objects of ClassType clsDatasource, the value of SubClassType is always sbclsRegular. For more information about the SubClassTypes enumeration, see Enumerations.


SupportedTxnDDL

Returns the value of the connection object’s Transaction DDL (data definition language) property, which indicates the source database’s ability to support DDL statements in transactions.

Data Type

Long

Access

Read-only

Remarks

The meaning of the value returned is specific to the database provider. For more information, see the Microsoft® ActiveX® Data Objects (ADO) documentation and the OLE DB documentation.


clsMemberProperty

The MemberProperty object defines the property of a level member. Like level members, these properties are read from the dimension table. A level can have any number of member properties. An object of ClassType clsMemberProperty provides collections and properties through its own internal interface. There are no methods associated with this object class. MemberProperty objects are contained in a parent level object’s MemberProperties collection.

Remarks

Access to the properties of an object of ClassType clsMemberProperty depends on the context in which it is used. MemberProperty objects are created and managed in the context of a database level and have read-write access. Cube and partition levels inherit member properties from the database level. Member properties accessed through cube and partition level objects are read-only.

See Also
About Decision Support Objects | Using Decision Support Objects
clsAggregationLevel | clsDatabaseLevel
clsCubeLevel | clsPartitionLevel


Collections, clsMemberProperty

An object of ClassType clsMemberProperty implements the following collection.

Collection | Description
CustomProperties | Collection of user-defined Property objects.

Access

Read/write


Properties, clsMemberProperty

An object of ClassType clsMemberProperty implements the following properties. The table also shows whether the property is read/write (R/W) or read-only (R).

Property | Description | Access
Caption | A label associated with the MemberProperty to be used for display purposes by OLAP clients. | R/W
ClassType | Returns an enumeration constant identifying the specific object type. | R
Description | A description of the MemberProperty. | R/W
Name | The name of the MemberProperty. | R/W (R after the object has been named)
OrdinalPosition | Returns the ordinal position of the MemberProperty object in the MemberProperties collection. | R
Parent | Returns a reference to the parent Level object. | R
SourceColumn | The dimension table name and column that contains values for the MemberProperty. | R/W
SubClassType | Returns an enumeration constant identifying the subclass type of the object. | R


Caption, clsMemberProperty

Caption

The Caption property of an object of ClassType clsMemberProperty contains a label associated with the property. The caption is used primarily for display purposes by client applications.

Applies To
MemberProperty

Data Type

String

Access

Read/write


ClassType, clsMemberProperty

ClassType

The ClassType property contains an enumeration constant identifying the specific class type of the MemberProperty object.

Applies To
MemberProperty

Data Type

ClassTypes (an enumeration)

For a complete list of class types, see Enumerations.

Access

Read-only


Description, clsMemberProperty

Description

The Description property of an object of ClassType clsMemberProperty contains a description of the object.

Applies To
MemberProperty

Data Type

String

Access

Read/write

Remarks

The primary mechanism for identifying the data in a MemberProperty is the Name property. The purpose of the Description property is to provide additional descriptive information.


Name, clsMemberProperty

Name

The Name property of an object of ClassType clsMemberProperty contains the name of the object.

Applies To
MemberProperty

Data Type

String

Access

Read/write (read-only after the object has been named)

Remarks

The primary mechanism for identifying the data in a MemberProperty is the Name property. The purpose of the Description property is to provide additional descriptive information.


OrdinalPosition, clsMemberProperty

OrdinalPosition

The OrdinalPosition property of an object of ClassType clsMemberProperty contains the ordinal position of a MemberProperty object within its parent object’s collection.

Applies To
MemberProperty

Data Type

Integer

Access

Read-only


Parent, clsMemberProperty

Parent

The Parent property of an object of ClassType clsMemberProperty contains a reference to the Level object to which the MemberProperty object belongs.

Applies To
MemberProperty

Data Type

DSO.Level

Access

Read-only


SourceColumn, clsMemberProperty

SourceColumn

The SourceColumn property contains a reference to the column in the dimension table that contains values for the member property.

Applies To
MemberProperty

Data Type

String

Access

Read/write

Example

'Assume an object (dsoLevel) of ClassType clsDimensionLevel exists

' Create a member property containing the name of the store manager

Dim dsoMemProp As DSO.MemberProperty

Set dsoMemProp = dsoLevel.MemberProperties.AddNew("Store Manager")

'Set the column which contains the names of the managers

dsoMemProp.SourceColumn = """store"".""store_manager"""


SubClassType, clsMemberProperty

SubClassType

The SubClassType property of an object of ClassType clsMemberProperty contains an enumeration constant identifying the subclass type of the object.

Applies To
MemberProperty

Data Type

SubClassTypes (an enumeration)

Access

Read-only

Remarks

A MemberProperty object’s SubClassType property can have a value of sbclsRegular only. For more information about the SubClassTypes enumeration, see Enumerations.


clsPartition

An object of ClassType clsPartition serves as a multidimensional data store, providing a specific implementation of the Decision Support Objects (DSO) MDStore interface. This object provides collections, methods, and properties through the MDStore interface.

Remarks

Partitions are common to large data warehouses where massive amounts of data must be managed efficiently. They enable you to segment your data in various storage modes and on various servers. You must create a separate partition for each physical partition (that is, each data source) the cube accesses.

Every cube has a default partition. Additional partitions can be defined to store portions of a cube’s data in different locations and with different aggregations. Each partition can have its own data source or inherit the parent cube’s default data source.

For more information about the object model hierarchy, see About Decision Support Objects and Interfaces.

Example

Use the following code to create a clsPartition object:

'Assume an object (dsoCube) of ClassType clsCube exists

Dim dsoPartition As DSO.MDStore

Set dsoPartition = dsoCube.MDStores.AddNew("MyPartition")

See Also
Using Decision Support Objects MDStore Interface


Collections, clsPartition

An object of ClassType clsPartition implements the following collections of the MDStore interface.

Collection | Description
CustomProperties | Collection of user-defined properties.
DataSources | The collection of DataSource objects used by the partition.
Dimensions | The collection of Dimension objects defined in the partition.
MDStores | The collection of Aggregation objects defined in the partition.
Measures | The collection of Measure objects defined in the partition.


Methods, clsPartition

An object of ClassType clsPartition implements the following methods of the MDStore interface.

Method | Description
Clone | Creates a copy of the property values and optionally collections of major and minor objects.
LockObject | Locks the partition to prevent multiple users of the cube from interfering with each other’s work.
Merge | Merges two partitions.
Process | Processes the partition.
UnlockObject | Releases a lock previously established by the LockObject method.
Update | Updates the partition definition in the metadata repository.


Properties, clsPartition

An object of ClassType clsPartition implements the following properties of the MDStore interface.

Property | Description
AggregationPrefix | The aggregation prefix for the partition store.
Analyzer | The PartitionAnalyzer object for this partition.
ClassType | Returns an enumeration constant identifying the specific object type.
Description | The description of the partition.
EstimatedRows | The estimated number of rows in the partition.
EstimatedSize | The estimated size of all the rows in bytes.
FromClause | Contains the SQL FROM clause from the list of tables used to define the partition’s dimensions and measures.
IsDefault | Indicates whether the partition is the default partition.
IsTemporary | Indicates whether the partition should be persisted in the repository.
IsReadWrite | Indicates whether the clsPartition object is writable.
IsValid | Indicates whether the structure of the partition is valid.
LastProcessed | The date and time the partition was last processed.
LastUpdated | User-specified date. Not used by OLAP Services.
Name | The name of the partition.
OlapMode | Returns an enumeration constant identifying the type of OLAP storage mode.
Parent | Returns a reference to the parent MDStore object.
Server | Returns a reference to the DSO.Server object.
SourceTable | The name of the fact table for the partition.
SourceTableFilter | Contains the WHERE clause of the SQL statement used to determine which source table rows are to be included in the partition.
State | Returns an enumeration constant indicating the difference between the partition object referenced by the client application and corresponding partition on the OLAP server.
SubClassType | Returns an enumeration constant identifying the subclass type of the object.


clsPartitionAnalyzer

Multidimensional database technology contains an inherent trade-off between precalculated aggregation storage requirements and online query process performance, as depicted in the following graph.

The higher the desired query performance, the more aggregations must be precalculated and stored.

A DSO object of ClassType clsPartitionAnalyzer encapsulates an algorithm for automatically designing a set of aggregations in a partition. It analyzes a partition’s schema and generates a collection of aggregations that improve query performance. You can run the analysis without constraints, or you can constrain the analysis in either of the following ways:

  • Specify one or more GoalQueries that you want to optimize.
  • Include existing aggregations or aggregations that should be preserved in the DesignedAggregations collection prior to running the analysis.

The steps in analyzing a partition are as follows:

  1. Initialize the analysis session using the InitializeDesign method.
  2. Specify one or more GoalQueries using the AddGoalQuery and PrepareGoalQueries methods. The resultant DesignedAggregations will optimize this set of GoalQueries. If no GoalQueries are specified, the analysis will yield a generalized optimization.
  3. Add one or more existing aggregations to the DesignedAggregations collection using the AddExistingAggregation method.
  4. Perform an initial analysis using the NextAnalysisStep method.

    The analysis generates new aggregations that are added to the DesignedAggregations collection. It also returns the calculated percentage performance gain, aggregation storage requirements, and total number of aggregations created.

  5. Review the results of the analysis step and determine whether you want to perform another analysis iteration. Running subsequent analysis steps adds new aggregations to the DesignedAggregations collection and recalculates the percentage performance gain, aggregation storage requirements, and total number of aggregations created.
  6. Manually or programmatically determine at what point you want to conclude the analysis.
  7. (Optional) At the conclusion of running clsPartitionAnalyzer, optionally replace the partition’s aggregations with the DesignedAggregations.
  8. Close the analysis with the CloseAggregationAnalysis method.

An object of ClassType clsPartitionAnalyzer provides collections, methods, and properties through its own internal interface.

For more information, see About Decision Support Objects.


Collections, clsPartitionAnalyzer

An object of ClassType clsPartitionAnalyzer implements the following collection.

Collection | Description
DesignedAggregations | Designed aggregations generated by the object of ClassType clsPartitionAnalyzer.

Access

Read-only


DesignedAggregations

The clsPartitionAnalyzer DesignedAggregations collection contains aggregations that have been manually added using the AddExistingAggregation method or automatically generated using the NextAnalysisStep method. At the conclusion of the clsPartitionAnalyzer session you can either choose to save these aggregations in the partition or discard them.

Data Type

Microsoft® Visual Basic® collection containing objects of ClassType clsAggregation.

Access

Read-only

Example

Use the following code to repeatedly invoke the NextAnalysisStep method and then save the DesignedAggregations in a Visual Basic collection. The analysis continues until one of the following two goals is reached:

  • Twenty or more aggregations are designed.
  • The storage requirements for the designed aggregations exceed 100,000 bytes.

For more information, see InitializeDesign.

'Assume the existence of an object (dsoPartAnalyzer) of ClassType
'clsPartitionAnalyzer

Private blnStopAdding     As Boolean

Private colDesignedAggs   As Collection

dsoPartAnalyzer.InitializeDesign

'Iterate thru analysis until either goal is reached

Do Until blnStopAdding

    If Not dsoPartAnalyzer.NextAnalysisStep(dblPercentageBenefit, _

    dblAccumulatedSize, lngAggregationsCount) Then

        blnStopAdding = True  'No New Aggregations Designed

    Else

        blnStopAdding = (lngAggregationsCount >= 20) Or _

        (dblAccumulatedSize >= 100000)

    End If

Loop

'Save the designed aggregations into VB collection object

Set colDesignedAggs = dsoPartAnalyzer.DesignedAggregations

This example is for illustrative purposes only. Saving the designed aggregations in a collection in the above manner is not necessary when using an object of ClassType clsPartitionAnalyzer.

See Also
clsAggregation | clsPartitionAnalyzer
clsPartition | Using Decision Support Objects


Methods, clsPartitionAnalyzer

An object of ClassType clsPartitionAnalyzer implements the following methods.

Method | Description
AddExistingAggregation | Adds an existing aggregation to the DesignedAggregations collection.
AddGoalQuery | Adds a particular query that is to be optimized.
CloseAggregationAnalysis | Closes this clsPartitionAnalyzer session and clears out the objects used during the analysis.
InitializeDesign | Checks the partition structure to ensure that clsPartitionAnalyzer can be run and initializes the objects necessary to perform the analysis.
NextAnalysisStep | Adds new aggregations to the DesignedAggregations collection and calculates the incremental performance gained versus additional aggregation storage requirements.
PrepareGoalQueries | Prepares the GoalQueries that were entered using the AddGoalQuery method for use in this analysis session.


AddExistingAggregation

The clsPartitionAnalyzer AddExistingAggregation method adds a specified aggregation to the DesignedAggregations collection and returns the calculated percentage performance gain (dblPercentageBenefit), aggregation storage requirements (dblAccumulatedSize), and total number of aggregations created (lngAggregationsCount) based upon the inclusion of this aggregation.

This method allows you to evaluate the impact of a particular aggregation on query performance. Subsequent analysis steps performed either by adding another existing aggregation or by using the NextAnalysisStep method will include this aggregation.

Syntax

dsoPartAnalyzer. AddExistingAggregation(Aggregation, dblPercentageBenefit, dblAccumulatedSize, lngAggregationsCount)

dsoPartAnalyzer
The object of ClassType clsPartitionAnalyzer used to perform the analysis.
Aggregation
The aggregation you want to add.
dblPercentageBenefit
The estimated percentage performance improvement that would be realized using the current collection of DesignedAggregations as opposed to querying against the underlying fact table. This variable is passed by reference.
dblAccumulatedSize
The estimated hard disk storage requirements (in bytes) for the current collection of DesignedAggregations. This variable is passed by reference.
lngAggregationsCount
The number of aggregations contained in the current collection of DesignedAggregations.
Example

Use the following code to add an aggregation, from an existing partition's MDStores (objects of ClassType clsAggregation) collection, named Agg123 to the DesignedAggregations collection and then run several analysis steps. The analysis continues until one of the following two goals is reached.

  • Twenty or more aggregations are designed.
  • The storage requirements for the designed aggregations exceed 100,000 bytes.

For more information, see InitializeDesign.

'Assume an object (dsoCube) of ClassType clsCube exists

'with two partitions referenced by partition objects

'dsoPart1 and dsoPart2

Dim bStopAdding As Boolean

Dim dblPercentageBenefit   As Double

Dim dblAccumulatedSize     As Double

Dim lngAggregationsCount   As Long

'Get existing aggregation "Agg123" from first partition

Dim dsoExistAgg As DSO.MDStore

Set dsoExistAgg = dsoPart1.MDStores("Agg123")

'Add aggregation to second partition

Dim dsoPartAnalyzer As DSO.PartitionAnalyzer

Set dsoPartAnalyzer = dsoPart2.Analyzer

dsoPartAnalyzer.AddExistingAggregation dsoExistAgg, _

  dblPercentageBenefit, dblAccumulatedSize, lngAggregationsCount

dsoPartAnalyzer.InitializeDesign

'Iterate thru analysis until either goal is reached

Do Until bStopAdding

    If Not dsoPartAnalyzer.NextAnalysisStep(dblPercentageBenefit, _

    dblAccumulatedSize, lngAggregationsCount) Then

        bStopAdding = True 'No New Aggregations Designed

    Else

        bStopAdding = (lngAggregationsCount >= 20) Or _

        (dblAccumulatedSize >= 100000)

    End If

Loop

See Also
clsAggregation | clsPartitionAnalyzer
clsPartition | Using Decision Support Objects


AddGoalQuery

The analysis performed by an object of ClassType clsPartitionAnalyzer can be constrained to optimize a particular subset of queries. Each of the queries in this subset is called a GoalQuery and is specified by picking a level from each of the dimensions of the partition. The clsPartitionAnalyzer AddGoalQuery method is used to specify each GoalQuery prior to running the partition analysis.

Syntax

dsoPartAnalyzer. AddGoalQuery(DatasetName, Frequency)

dsoPartAnalyzer
The object of ClassType clsPartitionAnalyzer used to perform the analysis.
DatasetName
A numeric string that specifies which level from each dimension is to be included in the query. This string must have the same number of characters as the number of dimensions in the partition. See the example below.
Frequency
A weighting factor that corresponds to the number of times that an existing DatasetName query has previously been executed. If this DatasetName is a new query, the value of Frequency that is entered is used to weight the partition analysis. The greater the frequency, the more weight that is placed on the query during the analysis.
Remarks

It is likely that different GoalQuery subsets may be optimized with significantly different DesignedAggregations. The performance and storage requirements may warrant the construction of separate partitions for each GoalQuery subset.

Example

Assume that a partition contains the following three dimensions and levels.

 | Customers | Products | Store Locations
Level #1 | All | All | All
Level #2 | Groups | Brand | Country
Level #3 | Customer# | SKU | State
Level #4 |  |  | City

A particular group of users needs to perform the following three queries:

  • All customers (Level #1) by product SKU (Level #3) by city (Level #4)

    This GoalQuery aggregation is specified with DatasetName = "134"

  • Individual customers (Level #3) by all products (Level #1) by state (Level #3)

    DatasetName = "313"

  • Customer groups (Level #2) by brand (Level #2) by country (Level #2)

    DatasetName = "222"

Use the following code to add these goal queries. For more information, see InitializeDesign.

'Assume the existence of an object (dsoPartAnalyzer) of ClassType
'clsPartitionAnalyzer

'Must call InitializeDesign first

dsoPartAnalyzer.InitializeDesign

'Add goal queries

dsoPartAnalyzer.AddGoalQuery "134", 1

dsoPartAnalyzer.AddGoalQuery "313", 1

dsoPartAnalyzer.AddGoalQuery "222", 1

'Required after all goal queries have been added.

dsoPartAnalyzer.PrepareGoalQueries

You can now run a series of NextAnalysisStep methods until you achieve the desired optimization.

See Also
clsAggregation | Properties Cross-Reference
clsPartition | Using Decision Support Objects
clsPartitionAnalyzer |


CloseAggregationAnalysis

The clsPartitionAnalyzer CloseAggregationAnalysis method closes this clsPartitionAnalyzer session and clears the temporary objects used during the analysis.

Syntax

dsoPartAnalyzer. CloseAggregationAnalysis

dsoPartAnalyzer
The object of ClassType clsPartitionAnalyzer used to perform the analysis.
Remarks

This method does not permanently save the DesignedAggregations collection in the partition. It clears the temporary objects used during the analysis. If you wish to save the results from a clsPartitionAnalyzer session you must do so programmatically. The sections in the following example show how to save the results of an analysis in the partition.

Example

Use the following code to run several analysis steps, save the results, and close the analysis. The analysis continues until one of the following two goals is reached:

  • Twenty or more aggregations are designed.
  • The storage requirements for the designed aggregations exceed 100,000 bytes.

For more information, see InitializeDesign.

'Assume the existence of an object (dsoPart) of ClassType
'clsPartition and an object (dsoPartAnalyzer) of ClassType
'clsPartitionAnalyzer

Private blnStopAdding      As Boolean

Dim dblPercentageBenefit   As Double

Dim dblAccumulatedSize     As Double

Dim lngAggregationsCount   As Long

dsoPartAnalyzer.InitializeDesign

'Iterate thru analysis until either goal is reached

Do Until blnStopAdding

    If Not dsoPartAnalyzer.NextAnalysisStep(dblPercentageBenefit, _

    dblAccumulatedSize, lngAggregationsCount) Then

        blnStopAdding = True 'No New Aggregations Designed

    Else

        blnStopAdding = (lngAggregationsCount >= 20) Or _

        (dblAccumulatedSize >= 100000)

    End If

Loop

'Delete existing aggregations

Do While dsoPart.MDStores.Count

    dsoPart.MDStores.Remove 1

Loop

'Add designed aggregations to partition

For Each Agg In dsoPartAnalyzer.DesignedAggregations

    dsoPart.MDStores.Add Agg

Next Agg

dsoPartAnalyzer.CloseAggregationAnalysis  'Close analysis

See Also
clsAggregation | Properties Cross-Reference
clsPartition | Using Decision Support Objects
clsPartitionAnalyzer |


InitializeDesign

The clsPartitionAnalyzer InitializeDesign method checks the partition structure to ensure that clsPartitionAnalyzer can be run on it and initializes the objects necessary to perform the analysis.

Syntax

dsoPartAnalyzer. InitializeDesign

dsoPartAnalyzer
The object of ClassType clsPartitionAnalyzer used to perform the analysis.
Example

Use the following code to create an object of ClassType clsPartitionAnalyzer and initialize its design.

Dim dsoServer         As DSO.Server

Dim dsoDB             As DSO.MDStore

Dim dsoCube           As DSO.MDStore

Dim dsoPart           As DSO.MDStore

Dim dsoAgg            As DSO.MDStore

Dim dsoPartAnalyzer   As DSO.PartitionAnalyzer

Dim strErr            As String

' Initialize server

' LocalHost defaults to = your Windows NT computer name

Set dsoServer = New DSO.Server

dsoServer.Connect("LocalHost")

Set dsoDB = Server.MDStores(1)  'Get first database on server

Debug.Print " Database Opened: " & dsoDB.Name

Set dsoCube = dsoDB.MDStores(1)  'Get first cube in database

Debug.Print "  Cube Opened: " & dsoCube.Name

Set dsoPart = dsoCube.MDStores(1)  'Get first partition in cube

Debug.Print "   Partition Opened: " & dsoPart.Name

Set dsoPartAnalyzer = dsoPart.Analyzer  'Instantiate an analyzer object

If dsoPartAnalyzer.InitializeDesign Then

    Debug.Print "InitializeDesign SUCCEEDED"

Else

    Debug.Print "InitializeDesign FAILED"

End If

See Also
clsAggregation | clsPartitionAnalyzer
clsPartition | Using Decision Support Objects


NextAnalysisStep

Each time the clsPartitionAnalyzer NextAnalysisStep method is invoked, it adds another set of aggregations to the DesignedAggregations collection. It calculates the query performance gained and the storage requirements for the additional aggregations.

Syntax

bRet = dsoPartAnalyzer. NextAnalysisStep(dblPercentageBenefit, dblAccumulatedSize, lngAggregationsCount)

bRet
A Boolean variable that receives the returned value: True if the method completed successfully; False if otherwise.
dsoPartAnalyzer
The object of ClassType clsPartitionAnalyzer used to perform the analysis.
dblPercentageBenefit
The estimated percentage performance improvement that would be realized using the current collection of DesignedAggregations as opposed to querying against the underlying fact table. This is an output parameter.
dblAccumulatedSize
The estimated hard disk storage requirements (in bytes) for the current collection of DesignedAggregations. This is an output parameter.
lngAggregationsCount
The number of aggregations contained in the current collection of DesignedAggregations. This is an output parameter.
Remarks

NextAnalysisStep analyzes a partition's schema and generates a collection of aggregations that improve query performance. You can run the analysis without constraints. If no constraints are specified, the analysis will yield a generalized optimization. For more information, see AddGoalQuery and PrepareGoalQueries.

Example

Use the following code to run a series of analyses until either of the following two goals is reached:

  • Twenty or more aggregations are designed.
  • The storage requirements for the designed aggregations exceed 100,000 bytes.

For more information, see CloseAggregationAnalysis and InitializeDesign.

Place the following code in your form’s Declarations section:

'Assume the existence of an object (dsoPartAnalyzer) of ClassType
'clsPartitionAnalyzer

Private blnStopAdding          As Boolean

Private dblPercentageBenefit   As Double

Private dblAccumulatedSize     As Double

Private lngAggregationsCount   As Long

'Iterate thru analysis until either goal is reached

Do Until blnStopAdding

    If Not dsoPartAnalyzer.NextAnalysisStep(dblPercentageBenefit, _

    dblAccumulatedSize, lngAggregationsCount) Then

        blnStopAdding = True 'No New Aggregations Designed

    Else

        blnStopAdding = (lngAggregationsCount >= 20) Or _

        (dblAccumulatedSize >= 100000)

    End If

Loop


PrepareGoalQueries

The clsPartitionAnalyzer PrepareGoalQueries method should be invoked after adding any GoalQueries that are to be used in the partition analysis.

Syntax

dsoPartAnalyzer. PrepareGoalQueries

Example

See AddGoalQuery.

See Also
AddGoalQuery | clsPartitionAnalyzer
clsAggregation | Using Decision Support Objects
clsPartition |


Properties, clsPartitionAnalyzer

An object of ClassType clsPartitionAnalyzer implements the following properties.

Property | Description
AggregationAnalysis Initialized | Indicates whether the partition analyzer has been initialized.
Parent | Contains a reference to the parent MDStore (ClassType clsPartition) object.

Access

Read-only


AggregationAnalysisInitialized

The clsPartitionAnalyzer AggregationAnalysisInitialized property contains the status of the last time that the InitializeDesign method was invoked: True if successful; False if otherwise.

Data Type

Boolean

Access

Read-only

Example

Use the following code to check the initialization status of an object of ClassType clsPartitionAnalyzer. For more information, see InitializeDesign.

'Assume the existence of an object (dsoPartAnalyzer) of ClassType
'clsPartitionAnalyzer

If dsoPartAnalyzer.AggregationAnalysisInitialized Then

    Debug.Print "Initialization OK"

Else

    Debug.Print "Not Initialized"

End If

See Also
clsAggregation | Properties Cross-Reference
clsPartition | Using Decision Support Objects
clsPartitionAnalyzer |


Parent

The clsPartitionAnalyzer Parent property contains a reference to the parent MDStore (ClassType clsPartition) object.

Data Type

MDStore

Access

Read-only

Example

Use the following code to refer to the parent object of the partition analyzer. For more information, see InitializeDesign.

'Assume the existence of an object (dsoPartAnalyzer) of ClassType
'clsPartitonAnalyzer

'Print the name of the clsPartitionAnalyzer's parent partition

Dim objParent As MDStore

Set objParent = dsoPartAnalyzer.Parent

Debug.Print objParent.Name

See Also
clsAggregation | Properties Cross-Reference
clsPartition | Using Decision Support Objects
clsPartitionAnalyzer |


clsPartitionDimension

An object of ClassType clsPartitionDimension is used to maintain the Dimension objects that are contained within a Partition object. It provides a specific implementation of the Decision Support Objects (DSO) Dimension interface. A clsPartitionDimension object provides collections and properties through the Dimension interface. There are no methods associated with an object of ClassType clsPartitionDimension.

Remarks

A partition cannot have fewer dimensions than its parent cube.

Example

Use the following code to create a clsPartitionDimension object:

'Assume an object (dsoCube) of ClassType clsCube exists

Dim dsoPart As MDStore

Dim dsoPartDim As DSO.Dimension

'Default partition

Set dsoPart = dsoCube.MDStore(1)

'Add a new dimension to the default partition

Set dsoPartDim = dsoPart.Dimensions.AddNew("Dim 2")

See Also
About Decision Support Objects | Dimension Interface
Using Decision Support Objects |


Collections, clsPartitionDimension

An object of ClassType clsPartitionDimension implements the following collections of the Dimension interface.

Collection | Description
CustomProperties | Collection of user-defined properties.
Levels | Contains the collection of Level objects.


Properties, clsPartitionDimension

An object of ClassType clsPartitionDimension implements the following properties of the Dimension interface.

Property | Description
ClassType | Returns an enumeration constant identifying the specific object type.
DataSource | Contains a reference to the DataSource object.
Description | Contains the description of the dimension.
DimensionType | Returns an enumeration constant identifying the specific type of dimension.
FromClause | Contains the SQL FROM clause for a dimension.
IsShared | Indicates whether the dimension is shared among cubes.
IsValid | Indicates whether the dimension structure is valid.
JoinClause | Contains the SQL JOIN clause for a dimension.
LastProcessed | Contains the date and time when the dimension was last processed.
LastUpdated | User-specified date. Not used by OLAP Services.
Name | Contains the dimension name.
OrdinalPosition | Returns the ordinal position of the dimension object within its parent object’s Dimensions collection.
Parent | Returns a reference to the parent MDStore object.
SourceTable | Contains the name of the source table of the dimension.
SubClassType | Returns an enumeration constant identifying the subclass type of the object.


clsPartitionLevel

An object of ClassType clsPartitionLevel provides a specific implementation of the Decision Support Objects (DSO) Level interface. It is used to maintain the level objects contained within a partition object.

A clsPartitionLevel object provides collections and properties through the Level interface. There are no methods associated with an object of ClassType clsPartitionLevel.

Remarks

Levels describe the dimension hierarchy from the highest (most aggregated) level to the lowest (most detailed) level of data. The All level of a dimension is the top level of a dimension that includes all the members of all the levels.

The following table shows an example of level positions of a time dimension in which the most detailed (daily) values are included in the next level (monthly), which are in turn included in the next level (quarterly), and so on.

Level | Ordinal Position
All | 1
Yearly | 2
Quarterly | 3
Monthly | 4
Daily | 5

The number of members in any level must always be greater than, or equal to, the number of members in the parent level.

A clsPartitionLevel object plays a unique role in the DSO object model in that its levels actually contain data slices. For more information, see SliceValue.

Example

Use the following code to create a clsPartitionLevel object called myPartLevel:

' Assume an object (dsoPart) of ClassType clsPartition exists

Dim dsoLev As DSO.Level

Set dsoLev = dsoPart.Levels.AddNew("Brand Name")

See Also
About Decision Support Objects Using Decision Support Objects


Collections, clsPartitionLevel

An object of ClassType clsPartitionLevel implements the following collections of the Level interface.

Collection | Description
CustomProperties | Collection of user-defined properties.


Properties, clsPartitionLevel

An object of ClassType clsPartitionLevel implements the following properties of the Level interface.

Property | Description
ClassType | Returns an enumeration constant identifying the specific object type.
ColumnSize | The size of the MemberKeyColumn of the aggregation level.
ColumnType | The data type of the MemberKeyColumn of the aggregation level.
Description | Contains the level description.
EstimatedSize | Contains the estimated number of members in a level.
FromClause | Contains the SQL FROM clause for the level.
IsDisabled | Indicates whether the level is disabled.
IsUnique | Indicates whether the level members are unique.
IsValid | Indicates whether the level structure is valid.
JoinClause | Contains the JOIN clause for the level.
LevelType | Returns an enumeration constant identifying the specific type of level.
MemberKeyColumn | Returns the name of the column that contains member keys of the partition level.
MemberNameColumn | Sets or returns the name of the column that contains member names.
Name | Contains the name of the level.
OrdinalPosition | Returns the ordinal position of the level in the parent object’s Levels collection.
Parent | Returns a reference to the parent Dimension object.
SliceValue | Contains the level member name used to define the partition slice.
SubClassType | Returns an enumeration constant identifying the subclass type of the object.


clsPartitionMeasure

An object of ClassType clsPartitionMeasure provides a specific implementation of the Decision Support Objects (DSO) Measure interface. This object is used to maintain the measure objects contained within a partition object.

A clsPartitionMeasure object provides collections and properties through the Measure interface. There are no methods associated with an object of ClassType clsPartitionMeasure.

Remarks

Measures are the quantitative, numerical columns from the fact table of a cube. When a cube is processed, the measures are aggregated across the dimensions in the cube. For example, a database contains the following tables:

  • Sales_Facts
  • Customer
  • Product
  • Product_Class
  • Promotion
  • Store
  • Calendar

The following diagram illustrates the relationships of these tables.

The Sales_Facts table is the cube fact table and the related tables are the cube dimensions. The Sales_Quantity, Unit_Price, and Unit_Cost fields are measures that can be aggregated across dimensions such as Store, Customer, or Product.

Example

Use the following code to create an object of ClassType clsPartitionMeasure.

'Assume an object (dsoPartition) of ClassType clsPartition exists

Dim dsoPartMeasure As DSO.Measure

Set dsoPartMeasure = dsoPartition.Measures.AddNew("MyPartMeasure")

See Also
About Decision Support Objects Using Decision Support Objects


Collections, clsPartitionMeasure

An object of ClassType clsPartitionMeasure implements the following collections of the Measure interface.

Collection | Description
CustomProperties | Collection of user-defined properties.


Properties, clsPartitionMeasure

An object of ClassType clsPartitionMeasure implements the following properties of the Measure interface.

Property | Description
AggregateFunction | Contains a value corresponding to the type of aggregation function used for a measure.
ClassType | Returns an enumeration constant identifying the specific object type.
Description | Contains the measure description.
FormatString | Contains the format used to display the measure values.
IsInternal | Indicates whether the measure is internal to the cube, that is, whether it is used only to store intermediate results during calculations of other measures.
IsValid | Indicates whether the measure structure is valid.
Name | Contains the measure name.
OrdinalPosition | Returns the ordinal position of the measure in the parent object’s Measures collection.
Parent | Returns a reference to the parent MDStore object.
SourceColumn | Contains the name of the measure column in the aggregated fact table.
SourceColumnType | Returns an ADO DB enumeration constant identifying the SourceColumn data type.
SubClassType | Returns an enumeration constant identifying the subclass type of the object.


clsServer

An object of ClassType clsServer provides methods and properties that enable you to control an OLAP server. This object is the root of the Decision Support Objects (DSO) object model tree that specifies the databases, cubes, and user roles managed by the server. With an object of ClassType clsServer you can:

  • Connect to the computer where the OLAP server service (MSSQLServerOLAPService) is running.
  • Start and stop the server.
  • Create new objects such as databases and cubes that define multidimensional data structures.
  • Manage existing multidimensional data structures.

A clsServer object provides collections, methods, and properties through its own internal interface.

Example

Use the following code to create and initialize a server.

'Create instance of server and connect

Public dsoServer As DSO.Server

Set dsoServer = New DSO.Server

'ServerName is the Windows NT Server where

'the OLAP server is loaded and running.

' An error is raised if we cannot connect

dsoServer.Connect("ServerName")

An alternate method would be as follows.

DsoServer = New DSO.Server

dsoServer.Name = "ServerName"

dsoServer.Connect

Note You can use “LocalHost” to specify the OLAP server running on the same computer as your DSO application.

See Also
About Decision Support Objects Using Decision Support Objects


Collections, clsServer

An object of ClassType clsServer implements the following collections.

Collection | Description
CustomProperties | Collection of user-defined properties.
MDStores | The collection of databases that define the multidimensional data managed by the server.

Access

Read/write


Methods, clsServer

An object of ClassType clsServer implements the following methods.

Method | Description
CloseServer | Releases all server resources and sets the object’s State to stateUnknown.
Connect | Connects to an OLAP server service (MSSQLServerOLAPService).
CreateObject | Creates an object.
LockObject | Requests the OLAP server lock a specified object.
Refresh | Reads all current metadata from the repository and modifies all objects in the object model of a session to match the current repository state.
UnlockAllObjects | Removes all locks issued by the current session from objects in the server’s object model.
UnlockObject | Removes a lock from a specified object.
Update | Updates an object definition in the metadata repository.


CloseServer

The CloseServer method of an object of ClassType clsServer releases all server resources and sets the object’s State to stateUnknown.

Syntax

dsoServer.CloseServer

dsoServer
The Decision Support Objects (DSO) server object to be closed.


Connect

Connects to an OLAP server service running on a Microsoft® Windows NT® Server computer.

Syntax

dsoServer.Connect([ServerName])

dsoServer
A Decision Support Objects (DSO) server object
ServerName
The name of the Windows NT Server where the OLAP server is installed and running. You can use “LocalHost” to specify the OLAP server running on the same computer as your DSO application.
Remarks

The Connect method sets the name of the server object. If you need to reconnect to the same server, do not specify the name on subsequent executions of the method on the same object.

Example

Public dsoServer As DSO.Server

Set dsoServer = New DSO.Server

'Assume "Server1" to be the name of the Windows NT Server

'where the OLAP server service is installed and running

dsoServer.Connect("Server1")  'Error is raised if unable to connect


CreateObject

The CreateObject method of an object of ClassType clsServer creates an object.

Syntax

objServer.CreateObject(ClassType, [SubClassType])

objServer
An object of ClassType clsServer.
ClassType
The class type of the object to be created. A member of the ClassTypes enumeration.
SubClassType
Optional. The subclass type of the object to be created. A member of the SubClassTypes enumeration. Default is sbclsRegular.
Remarks

When you are using DSO to construct major objects such as cubes, partitions, dimensions, and so forth, it is more convenient to use the AddNew method instead. The AddNew method creates an object of the appropriate ClassType in a collection and initializes its Name and Parent properties.

You can use the “LocalHost” to specify the OLAP server running on the same computer as your DSO application.

Example

' Assume objServer is a server object and objDB is a database object

Dim objCube as New DSO.MDStore

Set objCube = objServer.CreateObject("clsCube")

objCube.Name = "NewCube"

objDB.MDStores.Add objCube


LockObject

The LockObject method of an object of ClassType clsServer requests the OLAP server lock a specified object. The LockObject method locks an object to prevent actions of multiple users of the object from colliding.

Syntax

objServer.LockObject(obj, LockType, sLockDescription)

objServer
An object of ClassType clsServer.
obj
The object to lock.
LockType
One of the lock types of the OlapLockTypes enumeration.
sLockDescription
A string containing the description of the lock, available to other applications attempting to obtain a lock.
Remarks

For a complete discussion of object locking, see the LockObject method of the MDStore interface.


Refresh

The Refresh method of an object of ClassType clsServer reads all current metadata from the repository and modifies all objects in the session’s object model to match the current repository state.

Syntax

objServer.Refresh

objServer
An object of ClassType clsServer.
Remarks

All objects in the session’s object model are refreshed. This includes objects whose properties have not yet been saved to the repository as well as objects whose properties in the repository have been changed by other users.

Note Objects that are locked are not refreshed.


UnlockAllObjects

The UnlockAllObjects method of an object of ClassType clsServer removes all locks issued by the current session from objects in the server’s object model.

Syntax

bRet = objServer.UnlockAllObjects

bRet
A Boolean variable that receives the result of the method: True if successful; False if otherwise.
objServer
An object of ClassType clsServer.


UnlockObject

The UnlockObject method of an object of ClassType clsServer removes a lock from a specified object.

Syntax

objServer.UnlockObject(obj)

objServer
An object of ClassType clsServer.
obj
The object to unlock.


Update

The Update method of an object of ClassType clsServer updates an object definition in the metadata repository.

Syntax
object.Update
The object to update.
Remarks

Subordinate objects are automatically updated when you update an object that contains other objects, such as a cube that contains partitions, dimensions, and measures.


Properties, clsServer

An object of ClassType clsServer implements the following properties. The table also shows whether the property is read/write (R/W) or read-only (R).

Property | Description | Access
ClassType | Returns an enumeration constant identifying the specific class type. | R
Description | The description of the server object. | R/W
Edition | The edition of the installed Microsoft® SQL Server™ OLAP Services. | R
IsValid | Indicates whether the server settings are valid. | R
LockTimeout | The amount of time until a lock request fails due to timeout. | R/W
Name | The name of the server. | R/W
Parent | Contains a reference to the App object. | R
ServiceState | Contains the state of the OLAP server service (MSSQLServerOLAPService). | R/W
State | Returns an enumeration constant indicating the status of the connection to the OLAP server. | R
Timeout | The amount of time until a timeout error occurs during processing. | R/W


ClassType

The ClassType property of a server object returns an enumeration constant identifying the specific class type.

Data Type

ClassTypes (an enumeration)

Access

Read-only

Values

clsServer for all server objects


Description

The Description property of an object of ClassType clsServer contains the server description.

Data Type

String

Access

Read/write


Edition

The Edition property of an object of ClassType clsServer identifies the edition of the installed OLAP Services.

Data Type

OlapEditions (an enumeration)

Access

Read-only

Remarks

The functionality of OLAP Services varies according to the edition installed.

Edition | Description
olapEditionUnlimited | The OLAP server supports full functionality.
olapEditionPivotOnly | Reserved for future use.
olapEditionNoPartitions | The OLAP server does not support user-defined partitions.
olapEditionError | The edition of the OLAP server cannot be determined.


IsValid

The IsValid property of an object of ClassType clsServer indicates whether the server settings are valid.

Data Type

Boolean

Access

Read-only

Remarks

The validity check on the server object verifies that the server has a valid name.


LockTimeout

The LockTimeout property of an object of ClassType clsServer sets or returns the amount of time until a lock request fails due to timeout.

Data Type

Long

Access

Read/write

Remarks

Must not be less than zero. Default is 20 seconds.


Name

The Name property of an object of ClassType clsServer contains the name of the server object.

Data Type

String

Access

Read/write (read-only after the object has been named)


Parent

The Parent property of an object of ClassType clsServer contains a reference to the App object of the application.

Data Type

Object

Access

Read-only

Remarks

In an application using Decision Support Objects (DSO), an object of ClassType clsServer is the root of the object model tree. The App object is returned as its parent as a convenience.


ServiceState

The ServiceState property of an object of ClassType clsServer contains the execution state of the OLAP server service (MSSQLServerOLAPService). Read the property to query the status of the service. Set the property to a value to change the execution state of the service. Decision Support Objects (DSO) partially implements the service control functions of the Microsoft® Win32® API.

Data Type

Long

Values

The following values are returned when reading ServiceState.

Value | Description
SERVICE_CONTINUE_PENDING | The service continue is pending.
SERVICE_PAUSE_PENDING | The service pause is pending.
SERVICE_PAUSED | The service is paused.
SERVICE_RUNNING | The service is running.
SERVICE_START_PENDING | The service is starting.
SERVICE_STOP_PENDING | The service is stopping.
SERVICE_STOPPED | The service is not running.

The following values control the service when writing ServiceState.

Value | Requested Action
SERVICE_PAUSED | Pause the service.
SERVICE_RUNNING | Start the service if stopped or paused.
SERVICE_STOP | Stop the service.

Access

Read/write

Remarks

If a requested action cannot be completed, such as attempting to pause a service that is not running, an error appears.

Example

This example code can be incorporated into your program to control the execution state of MSSQLServerOLAPService using DSO.

' OLAP server service control constants

Const OLAP_SERVICE_RUNNING = &H4

Const OLAP_SERVICE_PAUSED = &H7

Const OLAP_SERVICE_STOP = &H1

' OLAP server status and error return constants

Const SERVICE_CONTINUE_PENDING = &H5

Const SERVICE_PAUSE_PENDING = &H6

Const SERVICE_PAUSED = &H7

Const SERVICE_RUNNING = &H4

Const SERVICE_START_PENDING = &H2

Const SERVICE_STOP_PENDING = &H3

Const SERVICE_STOPPED = &H1

' Additional error return constants

Const SERVICE_ACCEPT_PAUSE_CONTINUE = &H2

Const SERVICE_ACCEPT_SHUTDOWN = &H4

Const SERVICE_ACCEPT_STOP = &H1

Const SERVICE_ACTIVE = &H1

Const SERVICE_CHANGE_CONFIG = &H2

Const SERVICE_CONTROL_CONTINUE = &H3

Const SERVICE_CONTROL_INTERROGATE = &H4

Const SERVICE_CONTROL_PAUSE = &H2

Const SERVICE_CONTROL_SHUTDOWN = &H5

Const SERVICE_CONTROL_STOP = &H1

Const SERVICE_ENUMERATE_DEPENDENTS = &H8

Const SERVICE_INACTIVE = &H2

Const SERVICE_INTERROGATE = &H80

Const SERVICE_NO_CHANGE = &HFFFF

Const SERVICE_PAUSE_CONTINUE = &H40

Const SERVICE_QUERY_CONFIG = &H1

Const SERVICE_QUERY_STATUS = &H4

Const SERVICE_STATE_ALL = (SERVICE_ACTIVE Or SERVICE_INACTIVE)

Const SERVICE_USER_DEFINED_CONTROL = &H100

Const SERVICE_WAIT_MAX_SECONDS As Integer = 30

' ==============================================================

' OlapServiceControl function

' Returns True or False

' Calling parameters:

'     - objServer is an object of ClassType clsServer

'     that has been created and initialized

'     - iCmdReq is one of the OLAP server service

'     control constants

'     - lngStatus receives the status (one of the OLAP

'     server status constants)

'     - lngErr receives status if function fails (one of the OLAP

'     server status constants or one of the additional error constants)

Friend Function OlapServiceControl(objServer As Object, _

                                  ByVal iCmdReq As Integer, _

                                  ByRef lngStatus As Long, _

                                  ByRef lngErr As Long) As Boolean

Dim bRet             As Boolean

Dim lngSrvStat       As Long

Dim iCount           As Integer

Dim lngControlCmd    As Long

lngSrvStat = myServer.ServiceState

bRet = False

lngControlCmd = iCmdReq

lngErr = 0

Select Case iCmdReq

   Case SERVICE_RUNNING    ' Caller wants to start the server

      Select Case lngSrvStat

         Case SERVICE_RUNNING

            bRet = True

         Case SERVICE_PAUSED, SERVICE_STOPPED

            objServer.ServiceState = lngControlCmd

            For iCount = 1 To SERVICE_WAIT_MAX_SECONDS

               lngSrvStat = objServer.ServiceState

               If lngSrvStat = SERVICE_RUNNING Then

                  bRet = True

                  Exit For

               End If

               Call WaitNSeconds(1)

            Next iCount

      End Select

   Case SERVICE_PAUSED    ' Caller wants to pause the server

      Select Case lngSrvStat

         Case SERVICE_PAUSED

            bRet = True

         Case SERVICE_RUNNING

            objServer.ServiceState = lngControlCmd

            For iCount = 1 To SERVICE_WAIT_MAX_SECONDS

               lngSrvStat = objServer.ServiceState

               If lngSrvStat = SERVICE_PAUSED Then

                  bRet = True

                  Exit For

               End If

               Call WaitNSeconds(1)

            Next iCount

         Case SERVICE_STOPPED

            bRet = False

      End Select

   Case SERVICE_STOP     ' Caller wants to stop the server

      Select Case lngSrvStat

         Case SERVICE_STOPPED

            bRet = True

         Case SERVICE_PAUSED

            bRet = False

         Case SERVICE_RUNNING

            objServer.ServiceState = lngControlCmd

            For iCount = 1 To SERVICE_WAIT_MAX_SECONDS

               lngSrvStat = objServer.ServiceState

               If lngSrvStat = SERVICE_STOPPED Then

                  bRet = True

                  Exit For

               End If

               Call WaitNSeconds(1)

            Next iCount

      End Select

End Select

lngStatus = lngSrvStat

If Not bRet Then

   lngErr = lngSS

End If

OlapServiceControl = bRet

End Function

' ==============================================================

Private Sub WaitNSeconds(iSeconds As Integer)

Dim dteFinish      As Date

dteFinish = DateAdd("s", iSeconds, Now)

Do While Now < dteFinish

   DoEvents    ' Yield to other processes.

Loop

End Sub


State

The State property of an object of ClassType clsServer returns an enumeration constant indicating the status of the connection to the OLAP server.

Data Type

ServerStates (an enumeration)

Access

Read-only

Remarks

For a complete list of server states, see Enumerations.


Timeout

The Timeout property of an object of ClassType clsServer sets or returns the maximum amount of time between reports from an OLAP server before the server is considered to have timed out.

Data Type

Long

Access

Read/write

Remarks

The default value is 3600 seconds (one hour). You may need to increase this value if you experience timeout errors under conditions when the server has long wait times for the results of queries to a source database.


Command Interface

In Decision Support Objects (DSO), certain objects can contain a series of user-defined commands that are automatically executed on the PivotTable® Service client when you access the object. Such commands can include multidimensional expressions (MDX), calculated members, named sets, library references, or other commands. For more information about MDX, see Calculated Member Builder and MDX.

The objects that implement the Command interface have a ClassType property value of clsCubeCommand or clsDatabaseCommand. The Command interface provides collections, methods, and properties to manipulate these objects. For more information, see About Decision Support Objects.

Applies To
clsCubeCommand clsDatabaseCommand


Collections, Command Interface

The Command interface supports the following collection.

Collection | Contained Objects
CustomProperties | Property

Access

Read/write


Methods, Command Interface

The Command interface contains the following methods.

Method | Description
Clone | Copies an existing object to a target object of the same class type.
LockObject | Locks an object.
UnlockObject | Unlocks a previously locked object.
Update | Saves a command object definition in the metadata repository.

For the Command interface, these methods apply only to objects of ClassType clsDatabaseCommand.


Clone

The Clone method of the Command interface copies an existing object to a target object of the same class type. The target object must exist prior to using the Clone method.

Applies To
clsDatabaseCommand

Syntax

object.Clone(TargetObject [, CloneOptions])

object
The object whose property values are to be copied.
TargetObject
A previously created object of the same class type.
CloneOptions
For objects of ClassType clsCubeCommand and clsDatabaseCommand, the CloneOptions argument has no effect.
See Also
About Decision Support Objects | Using Decision Support Objects
Methods Cross-Reference |


LockObject

The LockObject method of the Command interface locks an object to prevent multiple users from concurrently changing the object.

Applies To
clsDatabaseCommand

Syntax

object.LockObject(LockType, LockDescription)

object
The object to lock.
LockType
One of the lock types of the OlapLockTypes enumeration.
LockDescription
A string containing a description of the lock, available to other applications attempting to obtain a lock.
Remarks

There are four types of locks defined by the OlapLockTypes enumeration: olapLockExtendedRead, olapLockProcess, olapLockRead, and olapLockWrite. For more information, see Enumerations.

Lock type | Applies to
olapLockExtendedRead | Not applicable for command objects. This lock applies only to objects that can be processed.
olapLockProcess | Not applicable for command objects. This lock applies only to objects that can be processed.
olapLockRead | This lock applies to all objects.
olapLockWrite | This lock applies to all objects.

For a complete discussion of object locking, see the LockObject method in MDStore Interface.

See Also
About Decision Support Objects | Using Decision Support Objects
UnlockObject | Methods Cross-Reference


UnlockObject

The UnlockObject method of the Command interface releases the lock on a command object previously established by the LockObject method.

Applies To
clsDatabaseCommand

Syntax

object.UnlockObject

object
The object to unlock.
Remarks

For a complete list of lock types, see OlapLockTypes in Enumerations.

See Also
About Decision Support Objects | Using Decision Support Objects
LockObject | Methods Cross-Reference


Update

The Update method of the Command interface saves a command object definition in the metadata repository.

Applies To
clsDatabaseCommand

Syntax

object.Update

object
The command object to update.
See Also
About Decision Support Objects | Using Decision Support Objects
Methods Cross-Reference |


Properties, Command Interface

The Command interface supports the following properties.

Property | Description
ClassType | Returns an enumeration constant identifying the specific class type.
CommandType | Returns an enumeration constant identifying the command option.
Description | Sets or returns the description of the command object.
IsValid | Indicates whether the Name and Statement properties are empty and that the command object belongs to a collection.
Name | Sets or returns the name of the command object.
OrdinalPosition | Returns the ordinal position of the command object in the parent MDStore object’s Commands collection.
Parent | Returns a reference to the parent MDStore object.
Statement | Sets or returns the text of the command statement.
SubClassType | Returns an enumeration constant identifying the subclass type of the object.

Access Cross- Reference

The following table shows whether the property is read/write (R/W) or read-only (R) for different objects.

Property | clsDatabaseCommand | clsCubeCommand
ClassType | R | R
CommandType | R/W | R/W
Description | R/W | R/W
IsValid | R | R
Name | R/W (R after the object has been named) | R/W (R after the object has been named)
OrdinalPosition | R | R
Parent | R | R
Statement | R/W | R/W
SubClassType | R | R


ClassType

The ClassType property of the Command interface contains an enumeration constant identifying the class designation within the Decision Support Objects (DSO) object model.

Applies To
clsCubeCommand clsDatabaseCommand

Data Type

ClassTypes (an enumeration)

Access

Read-only

Remarks

For a complete list of class types, see Enumerations.

Example

Use the following code to return the class type of a command object and determine which object class has been returned:

' Assume the existence of object CommandObject

Dim ClassType As ClassTypes

ClassType = CommandObject.ClassType

Select Case ClassType

   Case clsDatabaseCommand

        ' commands for a database command

   Case clsCubeCommand

        ' commands for a CubeCommand

   Case Else

        ' not a Command object

End Select

See Also
About Decision Support Objects | Using Decision Support Objects
SubClassType | Properties Cross-Reference


CommandType

The CommandType property of the Command interface contains an enumeration constant indentifying the command option.

Applies To
clsCubeCommand clsDatabaseCommand

Data Type

CommandTypes (an enumeration)

Each CommandType has an internally-assigned integer that is set to one of the following values.

CommandType | Description
cmdCreateMember | Used to define one or more calculated members.
cmdCreateSet | Used to define one or more sets of existing members.
cmdUseLibrary | Used to specify third-party DLLs containing functions to be registered for use in multidimensional expressions (MDX). For more information, see OrdinalPosition.
cmdUnknown | Used to define statements not included in any of the above command types, such as DROP MEMBER statements or new statements that may be added to future versions.

Access

Read/write

Remarks

For a complete list of command types, see Enumerations.

Examples

Use the following code to specify a command type for an existing command object:

CommandObject.CommandType = cmdCreateMember

Use the following code to determine which command type has been returned:

Dim CommandType As CommandTypes

CommandType = CommandObject.CommandType

Select Case CommandType

    Case cmdCreateMember

        ' Code to define calculated members

       Case cmsCreateSet

        ' Code to define sets of existing members

       Case cmdUseLibrary

        ' Code to use a third party library

    Case cmdUnknown

        ' Code to define other statements

End Select

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


Description

The Description property of the Command interface contains the description of the command object.

Applies To
clsCubeCommand clsDatabaseCommand

Data Type

String

Access

Read/write

Remarks

The primary mechanism for identifying individual command objects is the Name property. The purpose of the Description property is to provide additional descriptive information.

Example

Use the following code to set a command object description:

'Assume an object (dsoCmd) of ClassType clsCubeCommand exists

dsoCmd.Description = "Create a new profit member as sales-cost."

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


IsValid

The IsValid property of the Command interface indicates whether the object is valid.

Applies To
clsCubeCommand clsDatabaseCommand

Data Type

Boolean

Access

Read-only

Remarks

Because of the flexible nature of command objects, only the following checks are performed:

  • The Name property of the Command object is not empty.
  • The Command object belongs to a Commands collection.
  • The Statement property of the Command object is not empty.

The only way to see if a command functions the way you want it to is to execute it.

Example

Use the following code to return the validity status of a command object:

'Assume an object (dsoCmd) of ClassType clsCubeCommand exists

If dsoCmd.IsValid Then

    'Command is valid - save

Else

    'Error with one or more properties

End If

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


Name

The Name property of the Command interface contains the name of a command object.

Applies To
clsCubeCommand clsDatabaseCommand

Data Type

String

Access

Read/write (read-only after the object has been named)

Remarks

The primary mechanism for identifying individual command objects is the Name property. The purpose of the Description property is to provide additional descriptive information.

Example

Use the following code to set a command object name:

'Assume an object (dsoCmd) of ClassType clsCubeCommand exists

dsoCmd.Name = "Create Profit Member"

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


OrdinalPosition

The OrdinalPosition property of the Command interface contains the ordinal position of a command in the Commands collection in the parent MDStore object. Ordinal position determines the order in which commands are executed. This order is important when one command depends on another command (for example, a CREATE SET command that uses a member defined in a CREATE MEMBER command). In this case the CREATE MEMBER command should have a lower OrdinalPosition property value than the CREATE SET command.

Applies To
clsCubeCommand clsDatabaseCommand

Data Type

Integer

Access

Read-only

Example

Use the following code to return a the ordinal position of a command object:

'Assume an object (dsoDB) of ClassType clsDatabase exists

Dim strStatement As String

Dim iCounter As Integer

Dim dsoCmd As DSO.Command

'To check that the first command creates a member

Set dsoCmd = dsoDB.Commands(1)

For iCounter = 1 To dsoDB.Commands.Count

    Set dsoCmd = dsoDB.Commands(iCounter)

    Select Case dsoCmd.OrdinalPosition

        Case 1

         strStatement = dsoCmd.Statement

         If Left$(strStatement, 13) <> "CREATE MEMBER" Then

          'Error in command

        End If

       Case Else

          'Other validation

    End Select

Next iCounter

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


Parent

The Parent property of the Command interface contains a reference to the parent MDStore object.

Applies To
clsCubeCommand clsDatabaseCommand

Data Type

MDStore

The class of the parent object depends on the class of the command object.

Command object class | Parent object class
clsDatabaseCommand | clsDatabase
clsCubeCommand | clsCube

Access

Read-only

Example

Use the following code to determine the ClassType of the parent of a command object.

'Assume that an object (dsoCmd) exists.

Dim cmdParent As MDStore

Set cmdParent = dsoCmd.Parent

  Select Case cmdParent.ClassType

    Case clsDatabase

        'Code related to database

    Case clsCube

        'Code related to cube

End Select

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


Statement

The Statement property of the Command interface contains the text of the command statement.

Applies To
clsCubeCommand clsDatabaseCommand

Data Type

String

Access

Read/write

Remarks

For more information about types of command statements, see CommandType.

Examples

Use the following code to create a cmdCreateMember Command object:

CommandObject.Statement = "CREATE MEMBER MyCube.Measures.PROFIT AS 'Measures.Sales-Measures.Cost'"

Use the following code to create a cmdCreateSet Command object:

CommandObject.Statement = "CREATE SET MyCube.WestCoast AS '{Washington, Oregon, California}'"

Use the following code to create a cmdUseLibrary Command object:

CommandObject.Statement = "Use Library ""MyStatFunctions.dll"""

Use the following code to return a Command object statement:

Dim CommandStatement As String

CommandStatement = CommandObject.Statement

For more information about the CREATE MEMBER statements, see CREATE MEMBER and CREATE SET. For information about multidimensional expressions (MDX), see Function List and MDX.

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


SubClassType

The SubClassType property of the Command interface contains an enumeration constant identifying the subclass type of the object.

Applies To
clsCubeCommand clsDatabaseCommand

Data Type

SubClassTypes (an enumeration)

Access

Read-only

Remarks

Objects that implement the Command interface, that is, those that have a ClassType of clsCubeCommand or clsDatabaseCommand, have a SubClassType of sbclsRegular. For more information, see SubClassTypes in Enumerations.

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


Dimension Interface

Dimensions define the categories you use to organize multidimensional data. For example, typical dimensions in a sales cube might be Time, Store, Product, and Promotion. These dimensions enable you to analyze the sales of products by store and promotion over time. Dimensions organize the quantitative data provided by measures to answer questions about how much, what, where, when, and how, such as, “How many computers were sold in the NorthWest region in 1998 under the Student Discount promotion?”

A dimension provides a hierarchical organization to its members. For example, a typical Time dimension organizes time by years, quarters, months, and perhaps days. A Store dimension might organize stores geographically into countries, regions, states or provinces, cities, and individual stores. Product dimensions often organize products into categories, subcategories, brands, and product names. A Promotion dimension could describe special discounts that were applied to sale transactions.

Dimension hierarchies organize information into levels of granularity of data. For example, the Time dimension organizes its members from the least granular (all time in the database) through increasingly granular levels (years, quarters, and months) to the most granular level (days). Other dimensions organize different types of data, such as products, in similar levels of granularity. Dimension hierarchies provide the mechanism to summarize quantitative data (measures) into meaningful information.

In Decision Support Objects (DSO), dimensions are represented by objects that contain collections of other objects to represent levels within the dimensions. Typical levels for a time dimension are All, Year, Quarter, Month, and Day. The levels are defined by columns in the dimension table in the data warehouse database. When a dimension object is processed, the OLAP server constructs the dimension and its levels and populates them with members from the dimension table. For more information about DSO, see About Decision Support Objects.

Types of DSO Dimensions

DSO has several types of dimensions and contexts in which they are used: database dimensions, cube dimensions, partition dimensions, and aggregation dimensions. All dimensions are created in the Dimensions collection of a DSO database object. Database dimensions define the structure of the dimension and the data source where the dimension tables exist.

Any of the database dimensions can be used in a cube provided that a join can be made between the dimension table and the cube’s fact table. Cube dimensions have the same name as the corresponding database dimension. When a dimension is added to a cube’s Dimensions collection, DSO automatically creates all of the levels in the cube dimension. A cube dimension inherits its properties from the corresponding database dimension, with some of the properties available for customization in the cube. For example, you can specify how a cube dimension is used in the design of aggregations by setting the dimension’s AggregationUsage property.

A partition’s dimensions relate to its parent cube’s dimensions in the same manner that cube dimensions relate to database dimensions. Each partition dimension has a corresponding cube dimension and has the same number of levels as the cube dimension.

Aggregation dimensions are different. An aggregation dimension specifies the granularity of a partition dimension in an aggregation (a table that contains precalculated summary data). Aggregation dimensions can have fewer number of levels than the corresponding partition dimension. For example, if a partition contains an aggregation that summarizes sales by year for stores and product brands, the Time aggregation dimension will have only two levels: All and Year. The Store and Product dimensions in this aggregation will have all of their respective levels.

Private Dimensions and Shared Dimensions

DSO dimensions can be either shared or private. A shared dimension can be used in multiple cubes, but a private dimension can be used in only one cube. Unlike shared dimensions, private dimensions use a special naming convention to identify the cubes to which they belong. The name of a private dimension is constructed by using the cube name followed by the caret character (^) followed by the dimension name. For example, “NorthWestSales^Stores” would represent a private dimension of stores created for use in the NorthWestSales cube. This naming convention allows private dimensions in different cubes to have the same name - the cube name prefix ensures uniqueness within the database’s dimension collection. The qualifying cube name prefix of a private dimension name is not exposed in the user interface by the OLAP Manager. Instead, it uses the prefix to determine a dimension’s location in the tree view. To create a private dimension in DSO, name the dimension according to this convention.

You can determine whether a dimension is shared or private by testing its IsShared property to see whether it is True or False. This property is determined by DSO by examining the name of the dimension. The value of a dimension’s IsShared property is inherited by the cubes, their partitions, and their aggregations that use the dimension.

Except for the naming convention and usage restrictions, private dimensions are identical to shared dimensions.

Dimension Interface

All DSO dimension objects implement the Dimension interface, and you manipulate the dimension objects through the interface. The type of dimension is specified by the ClassType property of the dimension object. The ClassType of a database dimension is clsDatabaseDimension. The ClassType of cube, partition, and aggregation dimensions are clsCubeDimension, clsPartitionDimension, and clsAggregationDimension, respectively.

Dimensions reside in the Dimensions collection of the MDStore object that represents a database, cube, partition, or aggregation.

For more information about the Dimension interface collections, methods, and properties and applicability to the associated objects, see Collections, Methods, and Properties.

Virtual Dimensions

A virtual dimension is a special type of dimension. A virtual dimension can have only two levels, the default “All” level, and a second, virtual level that is made up of members of a different (regular) dimension’s member property. A virtual dimension can be used in a cube just like a regular dimension, except that the regular dimension whose member property is used in the virtual dimension must also be present in the same cube. Virtual dimensions enable you to create cubes that can analyze data in a variety of ways from a single dimension table. For example, you can create a virtual dimension that uses a member property containing product size and another that uses product color to analyze sales by size versus color.

A virtual dimension must have only two levels, the default “All” level, and a second level whose SubClassType property value is sbclsVirtual. In contrast, the SubClassType property for levels in a regular dimension is sbclsRegular. However, the dimension’s SubClassType value is sbclsRegular for both virtual and regular dimensions. To determine whether a dimension is a virtual dimension, check to see whether it contains a level whose SubClassType is sbclsVirtual.

Virtual dimensions can only be shared dimensions, not private. Regular dimensions that contain member properties used by virtual dimensions must also be shared dimensions.

The virtual level in a virtual dimension is constructed dynamically instead of being precalculated and stored in a cube. This saves storage space, but queries that use virtual dimensions are slower than ones that use only regular dimensions.

For more information about levels and virtual levels, see Level Interface. For more information about the SubClassTypes enumeration, see SubClassTypes in Enumerations.

Applies To
clsAggregationDimension | clsDatabaseDimension
clsCubeDimension | clsPartitionDimension

The basic model for using dimensions is to create them as shared dimensions in a database object’s dimensions collection. Then assign some or all of the dimensions to a cube. The dimensions assigned to a cube automatically apply to its partitions and aggregations, and can be explicitly associated with virtual cubes that use the cube.

The following example illustrates creating a database with two dimensions, DbDimA and DbDimB, and three cubes, CubeX, CubeY, and CubeZ. DbDimA is to be shared, but DbDimB is to be private to the cube named CubeZ. DbDimA can be associated with any or all of the cubes, but DbDimB can only be associated with CubeZ.

'Create and connect to a server

Dim dsoServer As DSO.Server

Set dsoServer = New DSO.Server

'MyServer is the name of the Windows NT Server

'where the OLAP server is installed and running

Set dsoServer.Name = ("MyServer")

dsoServer.Connect

'Create database object

Dim dsoDB As DSO.MDStore

Set dsoDB = dsoServer.MDStores.AddNew("MyDB")

'Create cubes

Dim CubeX As MDStore

Dim CubeY As MDStore

Dim CubeZ As MDStore

Dim dsoDS As DSO.Datasource

Set dsoDS = dsoDB.Datasources(1)

Set CubeX = dsoDB.MDStores.AddNew("CubeX")

Set CubeY = dsoDB.MDStores.AddNew("CubeY")

Set CubeZ = dsoDB.MDStores.AddNew("CubeZ")

'Create shared dimension

Dim DbDimA As DSO.Dimension

Set DbDimA = dsoDB.Dimensions.AddNew("DimA") 'Shared

'Associate shared dimension with CubeX and CubeY

CubeX.Dimensions.AddNew("DimA")

CubeY.Dimensions.AddNew("DimA")

'Create private dimension

Dim DbDimB As DSO.Dimension

Set DbDimB = dsoDB.Dimensions.AddNew("CubeZ^DimB")

'Associate private dimension with CubeZ

CubeZ.Dimensions.AddNew("CubeZ^DimB")


Collections, Dimension Interface

The Dimension interface implements the following collections.

Collection | Description
CustomProperties | The collection of user-defined properties.
Levels | The set of Level objects associated with a dimension object.

Access Cross-Reference

The following table shows whether the collection is read/write (R/W) or read-only (R) for different objects.

 | Database Dimension | Cube Dimension | Partition Dimension | Aggregation Dimension
Custom Properties | R/W | R/W | R/W | R/W
Levels | R/W | R | R | R


CustomProperties

The CustomProperties collection allows you to assign unique properties to objects that implement the Dimension interface.

Remarks

The CustomProperties collection contains properties that accept user-defined values to be used as required. For more information, see CustomProperties.

Applies To
clsAggregationDimension | clsDatabaseDimension
clsCubeDimension | clsPartitionDimension

Access

Read/write

See Also
About Decision Support Objects | Using Decision Support Objects
Collections Cross-Reference |


Levels

The Levels collection of the Dimension interface defines the set of Level objects associated with a dimension object.

Applies To
clsAggregationDimension | clsDatabaseDimension
clsCubeDimension | clsPartitionDimension

Data Type

OlapCollection

Access

The access type depends on the class of the dimension object.

Class | Access
clsDatabaseDimension | R/W
clsCubeDimension | R
clsPartitionDimension | R
clsAggregationDimension | R

See Also
About Decision Support Objects | Using Decision Support Objects
Collections Cross-Reference |


Methods, Dimension Interface

The Dimension interface supports the following methods.

Method | Description
Clone | Creates a copy of a dimension object.
LockObject | Locks a dimension object.
Process | Processes a dimension object.
UnlockObject | Unlocks a previously locked dimension object.
Update | Updates the definition of a dimension object in the metadata repository.

For the Dimension interface, these methods apply only to objects of ClassType clsDatabaseDimension.


Clone

The Clone method of the Dimension interface copies the properties and levels of an existing object to a target object of the same class type.

Applies To

clsDatabaseDimension

Syntax

object.Clone(TargetObject [, CloneOptions])

object
The object whose properties and levels are to be copied.
TargetObject
A previously created object of the same class type.
CloneOptions
The options to tell the method to what extent the source object should be duplicated.

Option | Description
cloneObjectProperties | The values of the properties of the source dimension are copied to the target dimension.
cloneMinorChildren | The values of the properties and levels contained in the source dimension are copied.
cloneMajorChildren | This option does not apply to dimension objects.

Example

'Assume an object (dsoDB) of ClassType clsDatabase exists

Dim dsoDimA As DSO.Dimension

Set dsoDimA = dsoDB.Dimensions.AddNew("DimA")

...

'Create target dimension and clone

Dim dsoDimB = DSO.Dimension

Set dsoDimB = dsoDB.Dimensions.AddNew("DimB")

dsoDimA.Clone(dsoDimB)

See Also
About Decision Support Objects | Using Decision Support Objects
Methods Cross-Reference |


LockObject

The LockObject method of the Dimension interface locks a dimension to prevent actions of multiple users of the dimension from colliding.

Applies To

clsDatabaseDimension

Syntax

object.LockObject(LockType, LockDescription)

object
The object to lock.
LockType
One of the enumerated constants of the OlapLockTypes enumeration.
LockDescription
A string containing the description of the lock, available to other applications attempting to obtain a lock.
Remarks

For a complete discussion of object locking, see the LockObject method in MDStore Interface.

See Also
About Decision Support Objects | Using Decision Support Objects
UnlockObject | Methods Cross-Reference


Process

The Process method of the Dimension interface creates and populates a dimension on the OLAP server. For more information, see Processing Dimensions. Applies To

clsDatabaseDimension

Syntax

object.Process(option)

object
The dimension object to process.
option
One of the ProcessTypes enumeration constants.
See Also
About Decision Support Objects | Using Decision Support Objects
Methods Cross-Reference |


UnlockObject

The UnlockObject method of the Dimension interface releases a lock on a dimension object previously established by the LockObject method.

Applies To
clsDatabaseDimension

Syntax

object.UnlockObject

object
The Dimension object to unlock.
See Also
About Decision Support Objects | Using Decision Support Objects
LockObject | Methods Cross-Reference


Update

The Update method of the Dimension interface updates the definition of a dimension object in the metadata repository.

Applies To
clsDatabaseDimension

Syntax

object.Update

object
The dimension object to update.
Remarks

Objects of ClassType clsAggregationDimension, clsCubeDimension, clsDatabaseDimension, and clsPartitionDimension do not implement the Update method. They are automatically updated when their parent MDStore object’s Update method is called. For more information, see Interfaces.

Example

'Assume an object (dsoDB) of ClassType clsDatabase exists

'Create Product Dimension for database

Dim dsoDim as DSO.Dimension

Set dsoDim = dsoDB.Dimensions.AddNew("Products")

'Create a datasource

Dim dsoDS As DSO.DataSource

Set dsoDS = dsoDB.DataSources.AddNew("FoodMart")

dsoDS.Name = "FoodMart"

dsoDS.ConnectionString = "Provider=MSDASQL.1;" &_

    "Persist Security Info=False;" &_

    "Data Source=FoodMart;" &_

    "Connect Timeout=15"

'Assign datasource to dimension

Set dsoDim.DataSource = dsoDS   'Dimension DataSource

dsoDim.FromClause = "product"   'Source Dimension Table

'Update the database

dsoDB.Update

See Also
About Decision Support Objects | Using Decision Support Objects
Methods Cross-Reference |


Properties, Dimension Interface

The Dimension interface supports the following properties.

Property | Description
AggregationUsage | Specifies how aggregations are to be designed for a dimension.
ClassType | Returns an enumeration constant identifying the specific object type.
DataSource | The data source object of a dimension object.
Description | Description of a dimension.
DimensionType | Returns an enumeration constant identifying the specific type of dimension.
FromClause | SQL FROM clause for a dimension.
IsShared | Indicates whether a dimension can be shared among cubes.
IsTemporary | Indicates whether an object is temporary.
IsValid | Indicates whether a dimension structure is valid.
JoinClause | SQL JOIN clause for a dimension.
LastProcessed | Date and time when a dimension was last processed.
LastUpdated | User-specified date. Not used by OLAP Services.
Name | Dimension name.
OrdinalPosition | Returns the ordinal position of the dimension object within its parent object’s Dimensions collection.
Parent | Returns a reference to the parent MDStore object.
SourceTable | Returns the name of the source table for the dimension.
State | Returns an enumeration constant indicating the difference between the dimension object referenced by the client application and the corresponding dimension on the OLAP server.
SubClassType | Returns an enumeration constant identifying the subclass type of the object.

Access Cross-Reference

The following table shows whether the property is read/write (R/W), read-only (R), or not applicable (n/a) for different objects.

Property | clsDatabase Dimension | clsCube Dimension | clsPartition Dimension | clsAggregation Dimension
AggregationUsage | n/a | R/W | R | n/a
ClassType | R | R | R | R
DataSource | R/W* | R* | R* | R
Description | R/W | R | R/W | n/a
Dimension Type | R/W | R | R | R
FromClause | R/W | R | R | R/W
IsShared | R | R | R | R
IsTemporary | R | R | R | R
IsValid | R | R | R | R
JoinClause | R/W | R | R | R/W
Last Processed | R | R | R | R
Last Updated | R/W | R | R | R
Name | R/W (R after the object has been named) | R/W (R after the object has been named) | R/W (R after the object has been named) | R/W (R after the object has been named)
Ordinal Position | R | R | R | R
Parent | R | R | R | R
SourceTable | R | R | R | n/a
State | R | n/a | n/a | R
SubClassType | R | R | R | R

* This property is not applicable (n/a) for virtual objects (that is, those of SubClassType sbclsVirtual).

Note The LastProcessed property of objects that implement the Dimension interface are not initialized until the dimension is processed for the first time. An error will be raised if LastProcessed is accessed when the State property of the dimension object equals olapStateNeverProcessed.


AggregationUsage

The AggregationUsage property of a dimension specifies how aggregations are to be designed for the dimension levels.

Applies To
clsCubeDimension clsPartitionDimension

Data Type

DimensionAggUsageTypes (an enumeration )

Access

The access type depends on the class of the object.

Class | Access
clsCubeDimension | R/W
clsPartitionDimension | R

Remarks

When aggregations are designed for a dimension, the value of this property determines which levels of a dimension will have aggregations created for them. This table describes how the value of this property affects the creation of aggregations for levels.

AggregationUsage | Description
dimAggUsageCustom | Aggregations will be created only for those levels whose EnableAggregations property is set to True.
dimAggUsageDetailsOnly | Aggregations will be created only for the lowest level in the dimension.
dimAggUsageStandard | The aggregation design algorithm will determine which levels to create aggregations for.
dimAggUsageTopOnly | Aggregations will be created only for the top (All) level.

Note For virtual dimensions, AggregationUsage is automatically set to dimAggUsageTopOnly. An error will be raised if you attempt to set this property on a virtual dimension.

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


ClassType

The ClassType property of the Dimension interface contains an enumeration constant identifying the specific class type.

Applies To
clsAggregationDimension | clsDatabaseDimension
clsCubeDimension | clsPartitionDimension

Data Type

ClassTypes (an enumeration )

For dimension objects, ClassType is one of the following:

  • clsDatabaseDimension
  • clsCubeDimension
  • clsPartitionDimension
  • clsAggregationDimension

For a complete list of class types, see Enumerations.

Access

Read-only

Example

Use the following code to obtain the class type of a dimension object:

Dim objClassType As ClassTypes
objClassType = DimensionObject.ClassType
Select Case objClassType
  Case clsDatabaseDimension
       ' commands for a DatabaseDimension
  Case clsCubeDimension
       ' commands for a CubeDimension or Virtual Cube Dimension
  Case clsPartitionDimension
       ' commands for a PartitionDimension
  Case clsAggregationDimension
       ' commands for an AggregationDimension
  Case Else
       ' other commands

End Select

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


DataSource

The DataSource property of the Dimension interface specifies the source of the data to be used by a dimension object.

Applies To
clsAggregationDimension | clsDatabaseDimension (excluding virtual dimensions)
clsCubeDimension (excluding virtual cube dimensions) | clsPartitionDimension (excluding virtual dimensions)

Data Type

clsDataSource

Access

The access type depends on the class of the dimension object.

Class | Access
clsDatabaseDimension | R/W
clsCubeDimension | R
clsPartitionDimension | R
clsAggregationDimension | R

Example

'Assume an object (dsoDB) of ClassType clsDatabase exists

'Add new data source to database

Dim dsoDS as DSO.DataSource

Set dsoDS = dsoDB.DataSources.AddNew("FoodMart")

dsoDS.Name = "FoodMart"

dsoDS.ConnectionString = "Provider=MSDASQL.1;" &_

"Persist Security Info=False;" &_

"Data Source=FoodMart; " &_

"Connect Timeout=15"

'Update the database

dsoDB.Update

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


Description

The Description property of the Dimension interface contains the description of a dimension object.

Applies To
clsCubeDimension | clsPartitionDimension
clsDatabaseDimension |

Data Type

String

Access

The access type depends on the class of the dimension object.

Class | Access
clsDatabaseDimension | R/W
clsCubeDimension | R
clsPartitionDimension | R/W

Remarks

The primary mechanism for identifying the data in a dimension is the Name property. The purpose of the Description property is to provide additional descriptive information.

Example

Use the following code to set the description of a dimension object:

'Assume an object (dsoDim) of ClassType clsDimension exists

dsoDim.Description = "Total dollar sales"

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


DimensionType

The DimensionType property of the Dimension interface contains an enumeration constant identifying the specific type of dimension.

Applies To
clsAggregationDimension | clsDatabaseDimension
clsCubeDimension | clsPartitionDimension

Data Type

DimensionTypes (an enumeration )

For dimension objects, DimensionType is set to one of the following values:

  • dimQuantitative
  • dimTime
  • dimRegular

For a complete list of dimension types, see Enumerations.

Access

The access type depends on the class of the dimension object.

Class | Access
clsDatabaseDimension | R/W
clsCubeDimension | R
clsPartitionDimension | R
clsAggregationDimension | R

Example

'Assume an object (dsoDim) of ClassType clsDatabaseDimension exists

dsoDim.DimensionType = dimRegular

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


FromClause

The FromClause property of the Dimension interface contains the SQL FROM clause for the dimension.

Applies To
clsAggregationDimension | clsDatabaseDimension
clsCubeDimension | clsPartitionDimension

Data Type

String

Access

The access type depends on the class of the dimension object.

Class | Access
clsDatabaseDimension | R/W
clsCubeDimension | R
clsPartitionDimension | R
clsAggregationDimension | R/W

Example

A database contains the following tables:

  • Sales_Facts
  • Customer
  • Product
  • Product_Class
  • Promotion
  • Store
  • Calendar

The following diagram illustrates the relationships of these tables.

Use the following code to create a dimension, assign a data source, and set the FromClause property:

'Assume an object (dsoDB) of ClassType clsDatabase exists

'Create Product Dimension for database

Dim dsoDim as DSO.Dimension

Set dsoDim = dsoDB.Dimensions.AddNew("Products")

'Create a datasource

Dim dsoDS As DSO.DataSource

Set dsoDS = dsoDB.DataSources.AddNew("FoodMart")

dsoDS.Name = "FoodMart"

dsoDS.ConnectionString = "Provider=MSDASQL.1;" &_

"Persist Security Info=False;" &_

"Data Source=FoodMart;" &_

"Connect Timeout=15"

'Assign datasource to dimension

Set dsoDim.DataSource = dsoDS   'Dimension DataSource

dsoDim.FromClause = "product"   'Source Dimension Table

'Update the database

dsoDB.Update

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


IsShared

The IsShared property of the Dimension interface indicates whether a dimension object can be shared among multiple MDStore objects. A dimension object that can be shared has a name in the form “MyDim”. A dimension object that is private to a cube has a name of the form “MyCube^MyDim” where “MyCube” is the cube that contains the dimension. The value of a database dimension’s IsShared property is inherited by the associated cubes (and their partitions, aggregations, and virtual cubes).

Applies To
clsAggregationDimension | clsDatabaseDimension
clsCubeDimension | clsPartitionDimension

Data Type

Boolean

Access

Read-only

Example

Use the following code to determine whether a dimension object can be shared with other dimension objects:

'Assume an object (dsoDim) of ClassType clsDatabaseDimension exists

Dim bShared As Boolean

bShared = dsoDim.IsShared

If bShared Then

    'Code for a shared dimension

Else

    'Code for a private dimension

End If

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


IsTemporary

The IsTemporary property of the Dimension interface indicates whether an object is temporary. Temporary objects are local to the session in which they are created, cannot be saved, and are not available to other users. To create a temporary dimension object, preface the name with the tilde (~) character.

Applies To
clsAggregationDimension | clsDatabaseDimension
clsCubeDimension | clsPartitionDimension

Data Type

Boolean

Access

Read-only

Remarks

A temporary object is not stored in the repository and is not available to other users. Temporary objects persist only during the session in which they are created unless renamed or cloned to another existing object having the same class type. Objects that are subordinate to a temporary object, such as levels for a dimension, internally inherit the parent object's IsTemporary setting.

Note Only temporary objects can be renamed by changing the Name property. Omitting the tilde character from the name of a temporary object means that it is no longer temporary preventing any subsequent renaming of the object. Also, executing the Update method of a temporary object has no effect. The object will not be saved to the repository until it is renamed without the tilde prefix.

Example

'Assume an object (dsoCube) of ClassType clsCube exists

Dim tmpDim As DSO.Dimension

Set tmpDim = dsoCube.Dimensions.AddNew("~MyDim") 'Temporary

'Add levels, member properties, process, etc.

...

'This is something we want to keep - so drop "~"

tmpDim.Name = "MyDim" 'No longer temporary

tmpCube.Update

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


IsValid

The IsValid property of the Dimension interface indicates whether the structure of a dimension object is valid. A structure is valid if it is fully and correctly defined. For example, a dimension object whose data source has not been defined is invalid.

Applies To
clsAggregationDimension | clsDatabaseDimension
clsCubeDimension | clsPartitionDimension

Data Type

Boolean

Access

Read-only

Example

Use the following code to determine whether the structure of a dimension object is valid:

'Assume an object (dsoDim) of ClassType clsDimension exists

Dim bValid As Boolean

bValid = dsoDim.IsValid

If bValid Then

    'Code to process a valid dimension

Else

    'Something is not valid - handle errors

End If

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


JoinClause

The JoinClause property of the Dimension interface contains the SQL JOIN clause for the dimension.

Applies To
clsAggregationDimension | clsDatabaseDimension
clsCubeDimension | clsPartitionDimension

Data Type

String

Access

The access type depends on the class of the dimension object.

Class | Access
clsDatabaseDimension | R/W
clsCubeDimension | R
clsPartitionDimension | R
clsAggregationDimension | R/W

Example

A database contains the following tables:

  • Sales_Facts
  • Customer
  • Product
  • Product_Class
  • Promotion
  • Store
  • Calendar

The following diagram illustrates the relationships of these tables.

Use the following code to return the JoinClause of the dimension object:

'Assume an object (dsoDim) of ClassType clsDimension exists

'and is associated with the Product dimension

Dim strJoinClause As String

strJoinClause = dsoDim.JoinClause

'The immediate window will display

'"product"."SKU"="product_class"."SKU"

Debug.Print "  Join Clause: " & strJoinClause

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


LastProcessed

The LastProcessed property of the Dimension interface contains the date and time when a dimension was last processed.

Applies To
clsAggregationDimension | clsDatabaseDimension
clsCubeDimension | clsPartitionDimension

Data Type

Date

Access

Read-only

Remarks

The LastProcessed property for an object is undefined and will raise an error if the value of the State property is olapStateNeverProcessed.

Example

Use the following code to determine when a dimension object was last processed:

'Assume an object (dsoDim) of ClassType clsDimension exists

If dsoDim.State <> olpaStateNeverProcessed Then

    If dsoDim.LastProcessed < date Then

        'Code to process the dimension

    End If

End If

See Also
About Decision Support Objects | Using Decision Support Objects
LastUpdated | Properties Cross-Reference


LastUpdated

The LastUpdated property of the Dimension interface is not used by OLAP Services. You can set this to any date/time value you want, for instance, to indicate when the source data was last changed.

Applies To
clsAggregationDimension | clsDatabaseDimension
clsCubeDimension | clsPartitionDimension

Data Type

Date

Access

The access type depends on the class of the dimension object.

Class | Access
clsDatabaseDimension | R/W
clsCubeDimension | R
clsPartitionDimension | R
clsAggregationDimension | R

Remarks

The LastUpdated property is not automatically set by any Decision Support Objects (DSO) method. It is provided as a means for client applications to indicate a date or time as to the validity of information. For example, a date of 12/31/96 may mean that the information stored in a cube is not valid after December of 1996.

Example

Use the following code to update an out-of date dimension :

'Assume an object (dsoDim) of ClassType clsDatabaseDimension exists

If dsoDim.LastUpdated < date Then

    'Code to update dimension

End If

See Also
About Decision Support Objects | Using Decision Support Objects
LastProcessed | Properties Cross-Reference


Name

The Name property of the Dimension interface contains the name of a dimension object.

Applies To
clsAggregationDimension | clsDatabaseDimension
clsCubeDimension | clsPartitionDimension

Data Type

String

Access

Read/write (read-only after the object has been named)

Remarks

The primary mechanism for identifying the data in a dimension is the Name property. The purpose of the Description property is to provide additional descriptive information.

Example

'Assume an object (dsoDB) of ClassType clsMDStore exists

Dim dsoDim As DSO.Dimension

Dim dimCounter As Integer

For dimCounter = 1 To dsoDB.Dimensions.Count

    Set dsoDim = dsoDB.Dimensions(dimCounter)

    If dsoDim.Name = "MyDim" Then

        'Do something with dimension

    End If

Next dimCounter

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


OrdinalPosition

The OrdinalPosition property of the Dimension interface contains the ordinal position of the dimension object within its parent object’s Dimensions collection.

Note The ordinal position is zero for all dimension objects in the collection of dimensions for a database. The position of a dimension within the collection is significant only when it is used in a cube, partition, or aggregation.

The OrdinalPosition property for dimensions is different from the OrdinalPosition property for levels. Dimensions are ordered by the time sequence in which you add them to their parent object. The ordinal position of levels, on the other hand, determines the hierarchy of the dimension.

Applies To
clsAggregationDimension | clsDatabaseDimension
clsCubeDimension | clsPartitionDimension

Data Type

Integer

Access

Read-only

Example

'Assume an object (dsoDim) of ClassType clsDimension exits

If dsoDim.OrdinalPosition = 1 Then

    'Code to handle first dimension

Else

    'Code to handle other dimensions

End If

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


Parent

The Parent property of the Dimension interface contains a reference to the parent MDStore object.

Applies To
clsAggregationDimension | clsDatabaseDimension
clsCubeDimension | clsPartitionDimension

Data Type

MDStore

The class of the parent object depends on the class of the dimension object.

Dimension object class | Parent object class
clsDatabaseDimension | clsDatabase
clsCubeDimension | clsCube
clsPartitionDimension | clsPartition
clsAggregationDimension | clsAggregation

Access

Read-only

Example

Use the following code to obtain the parent of a dimension object:

'Assume an object (dsoDim) of ClassType clsDimension exists

Dim objClassType As ClassTypes

objClassType = dsoDim.Parent

Select Case objClassType

    Case clsDatabase

        'Code for database parent object

    Case clsCube

        'Code for cube/virtual cube parent object

    Case clsPartiton

        'Code for partition parent object

    Case clsAggregation

        'Code for aggregation parent object

End Select

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


SourceTable

The SourceTable property of the Dimension interface contains the name of a dimension object’s primary source table. This is the name of the source table associated with the lowest level in the dimension. For example, if your cube has a dimension called Product, and it has levels called ProductCategory, ProductSubCategory, and ProductName, with ordinal positions 1, 2, and 3, respectively, the SourceTable property for the Product dimension will return the name of the source table associated with level ProductName.

Applies To
clsCubeDimension | clsPartitionDimension
clsDatabaseDimension |

Data Type

String

Access

Read-only

Example

Use the following code to obtain the name of the source table associated with level ProductName in dimension Product:

'Assume an object (dsoDim) of ClassType clsDimension exists

If dsoDim.SourceTable = "Product" Then

    'Code to handle dimension

End If

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


State

The State property of the Dimension interface contains an enumeration constant indicating the difference between the dimension object referenced by the client application and the corresponding dimension on the OLAP server.

Applies To
clsAggregationDimension clsDatabaseDimension

Data Type

OlapStateTypes (an enumeration)

Access

Read-only

Remarks

The State property indicates the current status of an object of ClassType clsDimension and is used to determine if processing of the dimension is required. The following table list the possible values for the State property.

State | Description
olapStateNeverProcessed | The database dimension has never been processed.
olapStateStructureChanged | The structure of the database dimension has changed.
olapStateMemberPropertiesChanged | The member properties have changed.
olapStateSourceMappingChanged | The source mappings for the database dimension have changed.
olapStateCurrent | The database dimension has been processed and is current.

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


SubClassType

The SubClassType property of the Dimension interface contains an enumeration constant identifying the subclass type of the object.

Applies To
clsAggregationDimension | clsDatabaseDimension
clsCubeDimension | clsPartitionDimension

Data Type

SubClassTypes (an enumeration)

Access

Read-only

Remarks

For objects of ClassType clsDimension, the SubClassType is sbclsRegular only. For more information, see SubClassTypes in Enumerations.

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


Glossary

add-in

A custom extension, written in any language that supports the Component Object Model (COM), usually Microsoft® Visual Basic®, that interacts with the OLAP Manager and provides specific functionality. Add-ins are registered with the OLAP Add-In Manager. They are called by the OLAP Add-In Manager in response to user actions in the user interface.

ADO MD

See Microsoft ActiveX Data Objects (Multidimensional).

aggregate function

In general, a function such as Sum, Count, Min, or Avg that calculates a summary value from one or more sets of input values. In multidimensional expressions (MDX), a function that returns a calculated summary value based on the context of a query and one or two sets of input values.

aggregation

A table or structure containing precalculated data for a cube. Aggregations support rapid and efficient querying of a multidimensional database. See also precalculate.

aggregation prefix

A string that is combined with a system-defined ID to create a unique name for a partition's aggregation table. A default string is generated based on the name of the partition and the name of its parent cube, but a user-defined string of up to 21 characters can be specified to replace the automatically-generated string.

All level

The optional highest level of a dimension, named "(All)" by default. The All level contains a single member that is the summary of all members of the immediately subordinate level.

ancestor

A member in a superior level in a dimension hierarchy that is related through lineage to the current member within the dimension hierarchy. For example, in a Time dimension containing the levels Quarter, Month, Day, Qtr1 is an ancestor of January 1st. See also child, descendant, parent, sibling.

authentication

The operation by which a system verifies a user's logon information.

authorization

The operation that verifies the permissions and access rights granted to a user.

axis

A set of tuples. Each tuple is a vector of members. A set of axes define the coordinates of a multidimensional dataset. For more information about axes, see the OLE DB for OLAP section in the OLE DB documentation.

See also tuple, slice.

calculated member

A member of a dimension whose value is calculated at run time using an expression. Calculated member values may be derived from other members' values. A calculated member is any member that is not an input member. For example, a calculated member Profit can be determined by subtracting the value of the member Costs from the value of the member Sales. See also Calculated Member Builder, input member.

Calculated Member Builder

A dialog box in the OLAP Manager used to create calculated members. You can pick parent members and members from a list. In addition, you can construct calculated value expressions using the cube data and analytical functions provided. See also calculated member.

cell

In a relational database, the addressable attribute of a row and column. In a cube, the set of properties, including a value, specified by the intersection when one member is selected from each dimension. See also coordinate.

child

A member in the next lower level in a hierarchy that is directly related the current member. For example, in a Time dimension containing the levels Quarter, Month, and Day, January is a child of Qtr1. See also ancestor, descendant, parent, sibling.

client application

An application that retrieves data from an OLAP server and performs local analysis and presentation of data from relational or multidimensional databases. Client applications connect to the OLAP server through the PivotTable Service component. See also PivotTable Service.

column

In a relational database, a location in a row in which a particular type of data is stored. Individual columns are characterized by their maximum length and the type of data that can be placed in them. The intersection of a column and row define a cell. A column is equivalent to a field.

commit

To save a change to a database, cube, or dimension.

An SQL COMMIT statement guarantees that all or none of the transaction’s modifications are made a permanent part of the database. A COMMIT statement also frees resources, such as locks, used by the transaction. See also rollback.

coordinate

An element (member or tuple) of an axis. The intersection of a set of coordinates determines a cell. See also cell.

cube

A subset of data, usually constructed from a data warehouse, organized and summarized into a multidimensional structure defined by a set of dimensions and measures. A cube’s data is stored in one or more partitions.

Cube editor

A tool in the OLAP Manager that you can use to create new cubes or edit existing ones. For information on working with the Cube editor, see “Building a Cube with the Cube Editor.”

cube file

See local cube.

data definition language (DDL)

The statements used by an application to define the structure (rather than the contents) of a database, cube, or table.

data explosion

The exponential growth in size of a multidimensional structure such as a cube due to the storage of precalculated data.

data mart

A subset of the contents of a data warehouse, stored within its own database. Data marts usually contain data focused at the department level or on a specific business area. See also data warehouse.

data scrubbing

The process of making data consistent either manually, or automatically using programs. For example, a database with inconsistent data might contain customer addresses that have the State column set to "WA" for one customer, but "Washington" for another. Data scrubbing is performed prior to or during the transfer of data to a data warehouse. See also data transformation.

data source

In general use, the source of data for an object such as a cube or dimension. Also, the specification of the information necessary to access source data. Sometimes refers to a DataSource object. See also data source name.

data source name (DSN)

The name assigned to an ODBC data source. Applications can use DSNs to request a connection to a system ODBC data source, which specifies the computer name and (optionally) database that the DSN maps to. A DSN can also refer to an OLE DB connection.

data transformation

A set of operations applied to source data before it can be stored in the destination using Microsoft SQL Server™ Data Transformation Services (DTS). For example, DTS allows calculating new values from one or more source columns, or breaking a single column into multiple values to be stored in separate destination columns. Data transformation is applied during the process of moving data into a data warehouse.

data warehouse

A relational and OLAP database specifically structured for query and analysis. A data warehouse typically contains data representing the business history of an organization.

dataset

In general, a collection of related information made up of separate elements that can be treated as a unit. In OLE DB for OLAP, the set of multidimensional data that is the result of executing an MDX statement. For more information about datasets, see the OLE DB documentation.

DDL

See data definition language.

Decision Support Objects (DSO)

The OLAP Services server object model. DSO is used to create applications that define and manage cubes and other objects. DSO can also be used to extend the functionality of the OLAP Manager or to automate the ongoing maintenance of your system.

denormalize

To introduce redundancy into a table in order to incorporate data from a related table. The related table can then be eliminated. Denormalization can improve efficiency and performance by reducing complexity in a data warehouse schema. See also star schema.

density

The relative percentage of a multidimensional structure's cells that contain data. OLAP Services stores only cells that contain data. A dense cube requires more storage than a sparse cube of identical structure design. See also data explosion, sparsity.

descendant

A member in a dimension hierarchy that is related to a member of a higher level within the same dimension. For example, in a Time dimension containing the levels Year, Quarter, Month, and Day, January is a descendant of 1997. See also ancestor, child, parent, sibling.

dimension

A structural attribute of a cube that is an organized hierarchy of categories that describe data in the fact table. These categories (levels) typically describe a similar set of members upon which the user wants to base an analysis. For example, a geography dimension might include levels for Country, Region, State or Province, and City. See also level, measure.

Dimension editor

A tool in the OLAP Manager that you can use to create, examine, and edit a dimension and its levels. It offers two views: Schema, which you can use to examine and edit the dimension table structure, and Browse, which you can use to check dimension data.

dimension hierarchy

One of the hierarchies of a dimension. See also hierarchy.

dimension table

A table in a data warehouse whose entries describe data in a fact table. Dimension tables present business entities. A database object stored in a data warehouse containing information used to reference the data stored in the fact table.

drill down/drill up

A technique for navigating through levels of data ranging from the most summarized (up) to the most detailed (down). For example, to view the details of sales data by year, a user can drill down to display sales data by quarter, and further to display data by month.

DSO

See Decision Support Objects.

fact

A row in a fact table in a data warehouse. A fact contains one or more numeric values that measure a data event such as a sales transaction.

fact table

A central table in a data warehouse that contains numerical measures and keys relating facts to dimension tables. Fact tables contain data that describes a specific event within a business, such as a bank transaction or product sale. See also star schema, snowflake schema.

field

See column.

filter

A set of criteria applied to records to show a subset of the records. An SQL WHERE clause expression that specifies a subset of records.

granularity

The degree of specificity of information contained in a data element. A fact table that has fine granularity contains many discrete facts such as individual sales transactions. A table that has coarse granularity stores facts that are summaries of individual elements, such as sales totals per day.

hierarchy

An arrangement of members of a dimension into levels based on parent-child relationships, such as Year, Quarter, Month, Day or Country, Region, State or Province, City. Members in a hierarchy are arranged from more general to more specific.

HOLAP (hybrid OLAP)

A storage mode that uses a combination of multidimensional data structures and relational database tables to store multidimensional data. OLAP Services stores aggregations for a HOLAP partition in a multidimensional structure and facts in a relational database. See also MOLAP, ROLAP.

hybrid OLAP

See HOLAP.

incremental update

The set of operations that adds new members to an existing cube or dimension, or that adds new data to a partition. One of three processing options for a cube or partition. One of two processing options for a dimension. See also process, refresh data.

index

In a relational database, an object that provides fast access to data in the rows of a table, based on key values. Indexes provide quick access to data and can enforce uniqueness on the rows in a table.

input member

A member whose value is loaded directly from the data warehouse instead of being calculated from other data. See also calculated member.

input set

The set of data provided to an MDX value expression upon which the expression operates. For more information about set value expressions, see the OLE DB documentation.

join

An association between a column in one table or query and a column of the same data type in another table or query. A join describes how data between tables or columns is related. A join is the result of executing an SQL JOIN statement.

key column

A column whose contents uniquely identify every row in a table.

level

An element of a dimension hierarchy. Levels describe the dimension order from the highest (most summarized) level to the lowest (most detailed) level of data. For example, possible levels for a Geography dimension are: Country, Region, State or Province, City. See also dimension, hierarchy.

level hierarchy

See dimension hierarchy. See also hierarchy.

library

In OLAP Services, a folder that contains shared objects such as shared dimensions that can be used by multiple objects within a database.

local cube

A cube created and stored with the extension .cub on a local computer using PivotTable® Service. See also PivotTable Service.

MDX

See multidimensional expressions.

measure

A quantitative, numerical column in a fact table. Measures typically represent the values that are analyzed. See also dimension.

member

An item in a dimension representing one or more occurrences of data. A member can be either unique or nonunique. For example, 1997 and 1998 represent unique members in the year level of a time dimension, whereas January represents nonunique members in the month level because there can be more than one January in the time dimension if it contains data for more than one year.

MemberKeyColumn

The property that specifies the identifiers for dimension members. The MemberKeyColumn can specify a column in a table or an expression that, when evaluated, results in a set of member identifiers. For example, a MonthNumber column in a time dimension table would contain numbers in the range 1 to 12, corresponding to the months of the year. See also MemberNameColumn, member variable.

MemberNameColumn

The property that associates names with identifiers for dimension members specified by the MemberKeyColumn property. For example, a MonthName column in a time dimension table would contain the names Jan, Feb, Mar, and so forth, to correspond to the numbers 1 to 12 in the MonthNumber column in the same table. These names are returned to the client when queries are evaluated and can be used to make the presented data more readable. See also MemberKeyColumn, member variable.

member property

Information about the members of a dimension level in addition to that contained in the dimension. For example, the color of a product or the telephone number of a sales representative. For more information about member properties, see the OLE DB documentation.

member variable

The value used internally by OLAP Services to identify a dimension member. MemberKeyColumn specifies the member variables for a dimension. For example, a number in the range 1 to 12 could be the member variable that corresponds to a month of the year. See also MemberKeyColumn, MemberNameColumn.

merge

The operation that combines two partitions into a single partition.

metadata

Information about the properties of data, such as the type of data in a column (numeric, text, and so on) or the length of a column. Information about the structure of data. Information that specifies the design of objects such as cubes or dimensions.

Microsoft ActiveX Data Objects (Multidimensional) (ADO MD)

A high-level, language-independent set of object-based data access interfaces optimized for multidimensional data applications. Visual Basic and other automation languages use ADO MD as the data access interface to multidimensional data storage. ADO MD is a part of ADO 2.0 and later.

Microsoft Management Console (MMC)

Microsoft Management Console (MMC) is an extensible, common console framework for management applications. OLAP Services uses MMC to host its user interface, the OLAP Manager.

MMC

See Microsoft Management Console.

MOLAP (multidimensional OLAP)

A storage mode that uses a proprietary multidimensional structure to store a partition's facts and aggregations. A partition's data is completely contained within the multidimensional structure. See also HOLAP, ROLAP.

multidimensional expressions (MDX)

A syntax used for querying multidimensional data. For more information about MDX, see the OLE DB documentation.

multidimensional OLAP

See MOLAP.

multidimensional structure

A database paradigm that treats data not as relational tables and columns, but as information cubes that contain dimension and summary data in cells, each addressed by a set of coordinates that specify a position in the structure's dimensions. For example, the cell at coordinates {SALES, 1997, WASHINGTON, SOFTWARE} would contain the summary of sales of software in Washington in 1997. See also cube.

ODBC

See Open Database Connectivity.

OLAP

See online analytical processing.

OLAP client

See client application.

OLAP Manager

A Microsoft Management Console (MMC) snap-in that provides a user interface for managing the OLAP server and for designing and creating multidimensional databases, cubes, and dimensions. See also Microsoft Management Console, snap-in.

OLAP server

The server component of OLAP Services that is specifically designed to create and maintain multidimensional data structures and provide multidimensional data in response to client queries. See also PivotTable Service.

OLE DB

A set of interfaces that expose data from a variety of sources using the Component Object Model (COM). OLE DB interfaces provide applications with uniform access to data stored in diverse information sources. These interfaces support the amount of DBMS functionality appropriate to the data source, enabling it to share its data.

OLE DB 2.0 and later includes OLE DB for OLAP, which supports multidimensional data access and querying. For more information about OLE DB, see the OLE DB documentation. See also OLE DB for OLAP.

OLE DB for OLAP

A section of OLE DB 2.0 and later that addresses multidimensional structures and OLAP. See also OLE DB.

OLTP

See online transaction processing.

online analytical processing (OLAP)

A technology that uses multidimensional structures to provide rapid access to data for analysis. The source data for OLAP is commonly stored in data warehouses in a relational database. See also HOLAP, MOLAP, ROLAP.

online transaction processing (OLTP)

A database management system representing the state of a particular business function at a specific point in time. An OLTP database is typically characterized by having large number of concurrent users actively adding and modifying data.

Open Database Connectivity (ODBC)

A database-material application programming interface (API) aligned with the American National Standards Institute (ANSI) and International Standards Organization (ISO) standards for a database Call Level Interface (CLI). ODBC supports access to any database for which an ODBC driver is available.

ordered set

A set of members returned in some specific order. The ORDER function in an MDX query returns an ordered set. For more information about the ORDER function, see the OLE DB documentation.

parent

A member in the next higher level in a hierarchy that is directly related to the current member. The parent value is usually a consolidation of the values of all of its children. For example, in a Time dimension containing the levels Quarter, Month, and Day, Qtr1 is the parent of January. See also ancestor, child, descendant, sibling.

partition

One of the storage containers for data and aggregations of a cube. Every cube contains one or more partitions. For a cube with multiple partitions, each partition can be stored separately in a different physical location. Each partition can be based on a different data source. Partitions are not visible to users; the cube appears to be a single object.

pass-through statement

A SELECT statement that is passed directly to the source database without modification or delay. In PivotTable Service, the PASSTHROUGH option is part of the INSERT INTO statement. See also PivotTable Service.

pivot

To rotate rows to columns, and vice versa, in a crosstabular data browser. Also refers to choosing dimensions from the set of available dimensions in a multidimensional data structure for display in the rows and columns of a crosstabular structure.

PivotTable Service

An in-process desktop OLAP server that communicates with the OLAP server and provides interfaces for use by client applications accessing OLAP data on the server. PivotTable Service is an OLE DB for OLAP provider. It provides online and offline data analysis functionality.

populate

See process.

precalculate

To compute combinations of data while a cube is being processed. Data is precalculated in anticipation of ad-hoc queries to minimize computation and disk access time when a query is submitted. For example, total quantity sold for a year can be precalculated from individual sales transactions during cube processing. See also aggregation.

primary dimension table

A dimension table in a snowflake schema in a data warehouse that is directly related to the fact table. Additional tables that complete the dimension definition are joined to the primary dimension table instead of to the fact table. See also snowflake schema, dimension table.

private dimension

A dimension created for and used by a specific cube. Unlike shared dimensions, private dimensions are available only to the cube in which they are created. See also shared dimension.

process

In a cube, the series of operations that rebuilds the cube’s structure, loads data into a multidimensional structure, calculates summaries, and saves the precalculated aggregations. As a verb, to populate a cube with data and aggregations. One of three processing options for a cube.

In a dimension, the operation that loads data from a dimension table in a data warehouse into the levels defined for a dimension and rebuilds the structure of the dimension. One of two processing options for a dimension.

See also incremental update, refresh data.

provider

An OLE DB provider. An in-process DLL that provides access to a database.

record

See row.

refresh data

The series of operations that clears data from a cube, loads the cube with new data from the data warehouse, and calculates aggregations. Refresh data is used when a cube's underlying data in the data warehouse has changed but the cube's structure and aggregation definitions remain the same. One of three processing options for a cube. See also process, incremental update.

relational database

A collection of information organized in tables that can be queried by using data in specified columns of one table to find additional related data in another table. Tables of a relational database are independent of the methods used by a database management system to access and manipulate records. A relational database supports SQL.

repository

The storage container for the metadata managed by Decision Support Objects (DSO). Metadata is stored in tables in a relational database and is used to define the parameters and properties of OLAP server objects. See also metadata.

relational OLAP

See ROLAP.

ROLAP (relational OLAP)

A storage mode that uses tables in a relational database to store multidimensional structures. See also HOLAP, MOLAP.

role

The relationship between access rights and Microsoft Windows NT groups and users. OLAP Services uses roles to manage the sets of users who can access cubes and the manner in which they access them.

rollback

The act of removing partially completed transactions after a database or other system failure. See also commit.

rotate

See pivot.

row

A data structure that is a collection of elements (columns), each with its own name and type. A row can be accessed as a collective unit of elements, or the elements can be accessed individually. A row is equivalent to a record. See also column.

sample data

Artificially-generated data presented in lieu of actual data when a cube is queried before it has been processed. Sample data enables you to view the effects of structure changes while modifying a cube.

schema

A description of multidimensional objects such as cubes, dimensions, and so forth.

server

An application, usually running on a dedicated computer, that provides resources or data to client workstations on a network. See also OLAP server.

shared dimension

A dimension created within a database that can be used by any cube in the database. See also private dimension.

sibling

A member in a dimension hierarchy that is a child of the same parent as a specified member. For example, in a Time dimension with Year and Month levels, the members January 1997 and February 1997 are siblings. See also ancestor, child, descendant, parent.

slice

A subset of the data in a cube, specified by limiting one or more dimensions by members of the dimension. For example, facts for a particular year constitute a slice of multiyear data.

snap-in

A program that runs within Microsoft Management Console (MMC) and provides specific added functionality. The OLAP Manager is a snap-in.

See also OLAP Manager, Microsoft Management Console.

snowflake schema

An extension of a star schema such that one or more dimensions are defined by multiple tables. In a snowflake schema, only primary dimension tables are joined to the fact table. Additional dimension tables are joined to primary dimension tables. See also star schema.

sparsity

The relative percentage of a multidimensional structure's cells that do not contain data. OLAP Services stores only cells that contain data. A sparse cube requires less storage than a dense cube of identical structure design. See also data explosion, density.

star schema

A relational database structure in which data is maintained in a single fact table at the center of the schema with additional dimension data stored in dimension tables. Each dimension table is directly related to the fact table by a key column. See also snowflake schema.

table

See fact table, dimension table.

time dimension

A dimension that breaks time down into levels such as Year, Quarter, Month, Day. In OLAP Services, a special type of dimension created from a date/time column.

transaction

A group of database operations combined into a logical unit of work that is either wholly committed or rolled back. A transaction is atomic, consistent, isolated, and durable.

tuple

An ordered collection of members from different dimensions. For example, (Boston, [1995]) is a tuple formed by members of two dimensions: Geography and Time. A single member is a degenerated case of a tuple and can be used as an expression without the parentheses. See also axis.

For more information about tuples, see the OLE DB documentation.

value expression

A multidimensional expression (MDX) that returns a value. Value expressions can operate on sets, tuples, members, levels, numbers, or strings. For example, set value expressions operate on member, tuple, and set elements to yield other sets. For more information about MDX expressions, see the OLE DB documentation.

virtual cube

A logical cube composed of dimensions and measures of one or more physical cubes, Virtual cubes are similar to views in a relational database. Virtual cubes combine data from the underlying physical cubes and require no additional data storage.

virtual dimension

A logical dimension based on the properties of members of a physical dimension. Members of a virtual dimension are derived from the values of one of the properties of a member of the physical dimension. For example, a virtual dimension Color could be derived from a product dimension containing member properties Color, Size, and Style; it could contain members Blue, Red, and Green, which are values for the property Color. See also dimension, member, member property.

write-back

The facility that enables users to apply changes to data in a cube. User-inititated changes to cube data are logged to a separate partition table associated with the cube and applied automatically as cube data is viewed. To the user it appears as if the data in the cube has changed.


Interfaces

There are a number of interfaces in Decision Support Objects (DSO). Objects that have similar functionality implement a common interface.

For example, databases, cubes, partitions, and aggregations implement the MDStore interface. An MDStore is a container of multidimensional data. Databases contain cubes of related information, cubes contain partitions that store data, and aggregations are precalculated summaries of data associated with partitions. MDStore objects have similar structures - they contain collections of dimensions that categorize the data, data sources that specify which relational database management system (RDBMS) contains fact and dimension tables, roles that define the security permissions, and so forth. For more information about these objects and how they work together in OLAP Services, see Administrator’s Guide.

Given a reference to an MDStore or any other DSO interface, you can determine which type of the object you are dealing with by examining the ClassType property. The objects that implement the MDStore interface can have the following class types: clsDatabase, clsCube, clsPartition, and clsAggregation. Throughout the programmer’s reference, DSO objects are identified using this “cls” notation. The DSO.ClassTypes enumeration contains the complete list of all DSO types.

Not all objects that implement a common interface implement the interface in the same way. Some objects do not implement all of the interface properties, methods and collections. For example, database objects (clsDatabase) implement the BeginTrans method, but cube objects (clsCube) do not. Some objects restrict access to certain property so that it becomes read-only rather than read/write. Attempt to access a property or invoke a method that is not implemented results in an error raised by DSO.

DSO also exposes the following interfaces: Dimension, Level, Measure, Role, and Command. The Dimension interface defines the properties, methods, and collections that you can use to manipulate different types of dimensions: database dimensions, cube dimensions, partition dimensions, and aggregation dimensions. The Level interface defines objects that specify the dimension hierarchy. Objects that implement the Measure interface describe the values stored in cubes, partitions, and aggregations. The Role interface is implemented by objects that contain access permissions to databases and cubes. The Command interface contains multidimensional expressions (MDX) statements to be executed on the OLAP server.

The following table lists the DSO interfaces and the types of objects that implement them.

Interface | Implemented by
Command | clsDatabaseCommand clsCubeCommand
Dimension | clsDatabaseDimension clsCubeDimension clsPartitionDimension clsAggregationDimension
Level | clsDatabaseLevel clsCubeLevel clsPartitionLevel clsAggregationLevel
MDStore | clsDatabase clsCube clsPartition clsAggregation
Measure | clsCubeMeasure clsPartitionMeasure clsAggregationMeasure
Role | clsDatabaseRole clsCubeRole

Some DSO objects do not implement a common interface. You directly access these objects: clsServer, clsDatasource, clsCubeAnalyzer, clsPartitionAnalyzer, and clsMemberProperty. For more information about these objects, see Objects.

For more information, see About Decision Support Objects and Objects.

Remarks

The DSO type library exposes several object classes such as Cube, Database, Partition, CubeDimension, and so forth. These objects are reserved for future use and are not intended to be used in DSO applications. You should use the named interfaces instead. For example, use the following code to create a new object of ClassType clsDatabase (a database object implements the MDStore interface):

'Assume an object (dsoServer) of ClassType clsServer exists

'Add Database object to server's MDStores collection

Dim dsoDB As MDStore   ' Declare the object by the interface

Set dsoDB = dsoServer.MDStores.AddNew("MyDB")

Important Always declare an object as the interface it implements. The first line of this code creates an object that will not operate correctly with DSO, although Microsoft® Visual Basic® will not return an error.

Dim dsoDB As DSO.Database  ' INCORRECT - DO NOT USE

Dim dsoDB As DSO.MDStore   ' CORRECT


Level Interface

Levels describe the hierarchy within a dimension from the highest (most aggregated) level to the lowest (most detailed) level of data. The following table shows an example of level positions of a time dimension in which the most detailed (day) values are included in the next level (week), which are in turn included in the next level (quarter), and so on.

Level | Position
All | 1
Year | 2
Quarter | 3
Week | 4
Day | 5

The number of members in any level must always be greater than, or equal to, the number of members in the parent level. For example, a level for Year may have four members 1994 through 1997. A subordinate level for Quarter would have four members for each year, Week would have 52 members for each year, and so forth. In Decision Support Objects (DSO), the objects that implement the Level interface have a ClassType property value of clsAggregationLevel, clsCubeLevel, clsDatabaseLevel, or clsPartitionLevel. Additionally, the SubClassType property for level objects may have a value of sbclsVirtual (as well as sbclsRegular) indicating that this is a virtual level. Virtual levels are used in the same manner as regular levels. The advantage to using a virtual level is that it does not add additional storage overhead to the cube because the members of a virtual level are calculated on demand. However, because members are dynamically calculated, virtual levels can be slower in responding to queries. By defining a level as virtual, the parent dimension object is also considered virtual. For more information, see Dimension Interface, MemberKeyColumn, and SubClassTypes in Enumerations.

The Level interface provides a number of properties to manipulate these objects. For an overview of levels and other objects, see About Decision Support Objects.

Each of these objects implements the Level interface, but not necessarily all of the Level properties. Other differences in the implementation of the Level interface exist among the objects. Some Level properties may be restricted to read-only access by some objects. For example, a clsDatabaseLevel object allows read and write access to its LevelType property whereas access to this property for a clsPartitionLevel object is read-only. For more information about the Level interface properties and applicability to the associated objects, see Collections and Properties.

There are no methods associated with the Level interface.

Applies To
clsAggregationLevel | clsDatabaseLevel
clsCubeLevel | clsPartitionLevel


Collections, Level Interface

The Level interface supports the following collections.

Collection | Description
CustomProperties | Collection of user-defined properties.
MemberProperties | Collection of objects of ClassType clsMemberProperty.

Access Cross-Reference

The following table shows whether the collection is read/write (R/W), read-only (R), or not applicable (n/a) for different objects.

Collection | clsDatabase Level | clsCubeLevel | clsPartition Level | clsAggregation Level
CustomProperties | R/W | R/W | R/W | R/W
MemberProperties | R/W | R | R | n/a

See Also
About Decision Support Objects | Using Decision Support Objects
Collections Cross-Reference |


Properties, Level Interface

The Level interface supports the following properties.

Property | Description
ClassType | Returns an enumeration constant identifying the specific object type.
ColumnSize | Size of the level aggregation column in an aggregation table.
ColumnType | Data type of the level aggregation column in an aggregation table.
Description | Description of the level.
EnableAggregations | Determines if aggregations will be created for a level in a dimension whose AggregationUsage property is set to dimAggUsageCustom.
EstimatedSize | Estimated number of members in the level.
FromClause | SQL FROM clause for a level.
IsDisabled | Indicates whether a level is disabled.
IsUnique | Indicates whether all members for a level are uniquely identified by the member key column alone.
IsValid | Indicates whether a level structure is valid.
JoinClause | SQL JOIN clause for a level.
LevelType | Returns an enumeration constant identifying the specific type of level.
MemberKeyColumn | Name of the column or expression that contains member keys.
MemberNameColumn | Name of the column or expression that contains member names.
Name | Name of a level.
Ordering | Specifies how a level should be ordered.
OrdinalPosition | Returns the ordinal position of a level in the collection of levels.
Parent | Returns a reference to the parent Dimension object.
SliceValue | Name of the level member used to define a partition slice.
SubClassType | Returns an enumeration constant identifying the subclass type of an object.

Access Cross-Reference

The following table shows whether the property is read/write (R/W), read-only (R), or not applicable (n/a) for different objects.

Property | clsDatabase Level | clsCube Level | clsPartition Level | clsAggregation Level
ClassType | R | R | R | R
ColumnSize | R/W | R | R | R
ColumnType | R/W | R | R | R
Description | R/W | R | R | R/W
EnableAggregations | n/a | R/W | R | n/a
EstimatedSize | R/W | R | R | R
FromClause | R | R | R | R
IsDisabled | n/a | R/W* | R | R
IsUnique | R/W | R | R | R
IsValid | R | R | R | R
JoinClause | R | R | R | R
LevelType | R/W | R | R | R
MemberKey Column | R/W | R/W* | R/W | R/W
MemberName Column | R/W | R | R | R
Name | R/W (R after the object has been named) | R/W (R after the object has been named) | R/W (R after the object has been named) | R/W (R after the object has been named)
Ordering | R/W | R | R | R
OrdinalPosition | R | R | R | R
Parent | R | R | R | R
SliceValue | n/a | n/a | R/W | n/a
SubClassType | R | R | R | R
* This property is read-only (R) for virtual cubes (that is, those of SubClassType sbclsVirtual).


ClassType

The ClassType property of the Level interface contains an enumeration constant identifying the specific class type.

Applies To
clsAggregationLevel | clsDatabaseLevel
clsCubeLevel | clsPartitionLevel

Data Type

ClassTypes (an enumeration)

For level objects, ClassType is set to one of the following values:

  • clsDatabaseLevel
  • clsCubeLevel
  • clsPartitionLevel
  • clsAggregationLevel

For a complete list of class types, see Enumerations.

Access

Read-only

Example

Use the following code to return the class type of a level object and determine which object class has been returned:

'Assume an object (dsoLevel) of ClassType clsLevel exists

Dim objClass As ClassTypes

objClassType = dsoLevel.ClassType

Select Case objClassType

  Case clsAggregationLevel

    ' AggregationLevel

  Case clsCubeLevel

    ' CubeLevel

  Case clsDatabaseLevel

    ' DatabaseLevel

  Case clsPartitionLevel

    ' PartitionLevel

End Select

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


ColumnSize

The ColumnSize property of the Level interface contains the size (in bytes) of the level aggregation column in an aggregation table.

Applies To
clsAggregationLevel | clsDatabaseLevel
clsCubeLevel | clsPartitionLevel

Data Type

Integer

Access

The access type depends on the level object class.

Class | Access
clsDatabaseLevel | R/W
clsCubeLevel | R
clsPartitionLevel | R
clsAggregationLevel | R

Remarks

The ColumnType and ColumnSize properties are only required when the storage mode for a cube is ROLAP. These values are used in defining the columns in the relational database table which will store the aggregation values. For more information, see Storage Modes (MOLAP, ROLAP, HOLAP).

Example

Use the following code to specify a column size of 40:

'Assume an object (dsoLev) of ClassType clsLevel exists

dsoLev.ColumnSize = 40

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


ColumnType

The ColumnType property of the Level interface contains the data type of the level aggregation column in an aggregation table.

Applies To
clsAggregationLevel | clsDatabaseLevel
clsCubeLevel | clsPartitionLevel

Data Type

ADODB.DataTypeEnum (an enumeration)

ColumnType is set to one of the following enumerated values.

ColumnTypeName | Value
Big Integer | adBigInt
Binary | adBinary
Boolean | adBoolean
String (Unicode) | adBSTR
Char | adChar
Currency | adCurrency
Date | adDate
Date | adDBDate
Time | adDBTime
Date & Time | AdDBTimeStamp
Decimal | adDecimal
Double | adDouble
Integer | adInteger
Numeric | adNumeric
Single | adSingle
Small Integer | adSmallInt
Tiny Integer | adTinyInt
Unsigned Big Integer | adUnsignedBigInt
Unsigned Integer | adUnsignedInt
Unsigned Small Integer | adUnsignedSmallInt
Unsigned Tiny Integer | adUnsignedTinyInt
Char (Unicode) | adWChar
Text | adChar

Access

The access type depends on the level object class.

Class | Access
clsDatabaseLevel | R/W
clsCubeLevel | R
clsPartitionLevel | R
clsAggregationLevel | R

Remarks

The ColumnType and ColumnSize properties are required only when the storage mode for a cube is ROLAP. These values are used in defining the columns in the relational database table which will store the aggregation values. For more information, see Storage Modes (MOLAP, ROLAP, HOLAP).

Example

Use the following code to specify a small integer ColumnType:

' Assume an object (dsoDim) of ClassType clsDimension exists

Set dsoLev = dsoDim.Levels.AddNew("Store Id")

dsoLev.MemberKeyColumn = """store"".""store_number"""

dsoLev.ColumnSize = 4

dsoLev.ColumnType = adInteger

dsoLev.EstimatedSize = 24

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


Description

The Description property of the Level interface contains the level description.

Applies To
clsAggregationLevel | clsDatabaseLevel
clsCubeLevel | clsPartitionLevel

Data Type

String

Access

The access type depends on the level object class.

Class | Access
clsDatabaseLevel | R/W
clsCubeLevel | R
clsPartitionLevel | R
clsAggregationLevel | R/W

Remarks

The primary mechanism for identifying the data in a level object is the Name property. The purpose of the Description property is to provide additional descriptive information.

Example

' Assume an object (dsoLevel) of ClassType clsLevel exists

dsoLevel.Description = "Sales for 1998"

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


EnableAggregations

The EnableAggregations property of the Level interface specifies if aggregations are to be enabled for the level object. For more information about enabling aggregations, see the AggregationUsage property in Dimension Interface.

Applies To
clsCubeLevel clsPartitionLevel

Data Type

Boolean

Access

The access type depends on the level object class.

Class | Access
clsCubeLevel | R/W
clsPartitionLevel | R


EstimatedSize

The EstimatedSize property of the Level interface contains the estimated number of members in the level object. The EstimatedSize property is used by the partition analyzer when designing aggregations.

Applies To
clsAggregationLevel | clsDatabaseLevel
clsCubeLevel | clsPartitionLevel

Data Type

Long

Access

The access type depends on the level object class.

Class | Access
clsDatabaseLevel | R/W
clsCubeLevel | R
clsPartitionLevel | R
clsAggregationLevel | R

Remarks

The EstimatedSize property is used during analysis of a partition for designing aggregations. The value does not need to be precise, but a close approximation should be provided.

Example

' Assume an object (dsoDim) of ClassType clsDimension exists

Set dsoLev = dsoDim.Levels.AddNew("Store Id")

dsoLev.MemberKeyColumn = """store"".""store_number"""

dsoLev.ColumnSize = 4

dsoLev.ColumnType = adInteger

dsoLev.EstimatedSize = 24

Note The EstimatedSize property for the (All) level is read-only and always returns 1.

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


FromClause

The FromClause property of the Level interface contains the SQL FROM clause for the level.

Applies To
clsAggregationLevel | clsDatabaseLevel
clsCubeLevel | clsPartitionLevel

Data Type

String

Access

Read/only

Example

A database contains the following tables:

  • Sales_Facts
  • Customer
  • Product
  • Product_Class
  • Promotion
  • Store
  • Calendar

The following diagram illustrates the relationships of these tables.

Use the following code to return a level’s FROM clause:

' Assume an object (dsoLevel) of ClassType clsLevel

' and is associated with the Store dimension and

' Store_Name level

Debug.Print "        Level: " & dsoLevel.Name

Debug.Print "  From Clause: " & dsoLevel.FromClause

The display in the immediate window would show the following:

        Level: Store_Name

  From Clause: "store"

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


IsDisabled

The IsDisabled property of the Level interface indicates whether the level is disabled.

Applies To
clsAggregationLevel | clsPartitionLevel
clsCubeLevel |

Data Type

Boolean

Access

The access type depends on the level object class.

Class | Access
clsCubeLevel | R/W
clsCubeLevel (for virtual cubes) | R
clsPartitionLevel | R
clsAggregationLevel | R

Remarks

If a level is disabled, it does not show up in a processed cube (that is, you cannot see the level when querying the cube using MDX).

Note When a level is disabled, all subordinate levels are automatically disabled. When a level is enabled, all higher levels are automatically enabled. At least one level must be enabled.

Example

Use the following code to disable a level object:

' Assume an object (dsoCubeLevel) of ClassType clsCubeLevel exists

dsoCubeLevel.IsDisabled = True

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


IsUnique

The IsUnique property of the Level interface indicates whether the members for a level are uniquely identified by the level’s member key column alone.

Applies To
clsAggregationLevel | clsDatabaseLevel
clsCubeLevel | clsPartitionLevel

Data Type

Boolean

Access

The access type depends on the level object class.

Class | Access
clsDatabaseLevel | R/W
clsCubeLevel | R
clsPartitionLevel | R
clsAggregationLevel | R

Remarks

If the IsUnique property is True, the level’s MemberKeyColumn property uniquely identifies all level members. For example, in the following diagram, the member key column for Level 2 -Years would be all that is required to uniquely identify the levels 1997 and 1998. However, the member key column alone for Level 3 - Quarters would not uniquely identify a quarter since the levels are duplicated under each year level. To uniquely identify the level 1997 - Q1, the member key columns for Level 2 - Years and Level 3 - Quarters would need to be combined.

Example

If a new level for months of the year named Month1, Month2, ... Month12 were added below the quarter level, the IsUnique property would be set to False, because MemberKeyColumn would not uniquely identify each month level.

' Assume an object (dsoDim) of ClassType clsDimension exists

Dim dsoLevel As DSO.Level

Set dsoLevel = dsoDim.Levels.AddNew("Months")

dsoLevel.IsUnique = False

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


IsValid

The IsValid property of the Level interface indicates whether the level structure is valid. A level is valid if it is fully and correctly defined. For example, a level whose FromClause has not been defined is invalid.

Applies To
clsAggregationLevel | clsDatabaseLevel
clsCubeLevel | clsPartitionLevel

Data Type

Boolean

Access

Read-only

Example

Use the following code to return the validity status of a level object:

' Assume an object (dsoLevel) of ClassType clsLevel exists

If Not dsoLevel.IsValid Then

  'Code to validate level definition

End If

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


JoinClause

The JoinClause property of the Level interface contains a reference to a set of tables in a fashion similar to the FromClause property. JoinClause, however, shows how the tables are linked.

Applies To
clsAggregationLevel | clsDatabaseLevel
clsCubeLevel | clsPartitionLevel

Data Type

String

Access

Read-only

Example

A database contains the following tables:

  • Sales_Facts
  • Customer
  • Product
  • Product_Class
  • Promotion
  • Store
  • Calendar

The following diagram illustrates the relationships of these tables.

Use the following code to return the JoinClause of the level object:

' Assume an object (dsoLevel) of ClassType clsLevel

' and is associated with the Product dimension and

' SKU level

Debug.Print "        Level: " & dsoLevel.Name

Debug.Print "  Join Clause: " & dsoLevel.JoinClause

The display in the immediate window would show the following:

        Level: SKU

  Join Clause: "product"."SKU"="product_class"."SKU"

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


LevelType

The LevelType property of the Level interface returns an enumeration constant identifying the specific type of level.

Applies To
clsAggregationLevel | clsDatabaseLevel
clsCubeLevel | clsPartitionLevel

Data Type

LevelTypes (an enumeration)

Access

The access type depends on the level object class.

Class | Access
clsDatabaseLevel | R/W
clsCubeLevel | R
clsPartitionLevel | R
clsAggregationLevel | R

Remarks

The LevelType property may be set to one of the constants enumerated by the LevelTypes enumeration. The first level must be unique and always be of type levAll. Subsequent levels are of the type levRegular with the exception of levels in a time dimension. Time levels have their LevelType property set to one of the time level constants such as levTimeYears or levTimeMonths. Time levels must be created in time hierarchy fashion. For example, the first level in a time dimension (other than All) would have the type levTimeYears. The second, levTimeMonths, and so on. For a complete list of level types, see Enumerations.

Example

Use the following code to set a the level type of a level object to days:

LevelObject.LevelType = levTimeDays

Use the following code to return a the level type of a level object and determine which level type has been returned:

'Assume an object (dsoLevel) of ClassType clsDatabaseLevel exists

Dim objType As LevelTypes

objType = dsoLevel.LevelType

Select Case objType

  Case levRegular

    ' Commands for levRegular

  Case levAll

    ' Commands for levAll

  Case Else

    ' other commands

End Select

See Also
About Decision Support Objects | Using Decision Support Objects
LevelTypes | Properties Cross-Reference


MemberKeyColumn

The MemberKeyColumn property of the Level interface contains the name or expression of the column that contains member keys. For a virtual level, the MemberKeyColumn property contains the name of the dimension, level, and member property of an existing dimension in the database.

Applies To
clsAggregationLevel | clsDatabaseLevel
clsCubeLevel | clsPartitionLevel

Data Type

String

Access

The access type depends on the level object class.

Class | Access
clsDatabaseLevel | R/W
clsCubeLevel | R/W
clsCubeLevel (for virtual cubes) | R
clsPartitionLevel | R/W
clsAggregationLevel | R/W

Remarks

MemberKeyColumn can be any valid SQL expression involving one or more columns from a single table. For example, either of the following is a valid MemberKeyColumn expression that uses the “Product”.”Prod_Year” column:

"Product"."Prod_Year"

DatePart('q',"Product"."Prod_Year")

In relational terms, a key is a set of one or more columns that uniquely identifies an entity. MemberKeyColumn is a key in this sense if the IsUnique property of a level is True. If IsUnique is False, MemberKeyColumn uniquely identifies a member within the context of a parent member only. For example, months are unique only within the context of a given year.

For virtual levels (that is, those of SubClassType sbclsVirtual) the MemberKeyColumn is mapped to the member property of a level within an existing dimension, for example, [Product].[Brand Name].[Company]. When creating levels, it is recommended that the lowest level have unique members as this will improve processing of the cube. MemberKeyColumn controls the way in which the dimensions within a cube are processed. For lookups, the Decision Support Objects (DSO) object model expects the fact table to contain member key values but not necessarily member names. The user, however, sees the member names rather than the keys.

Example

Use the following code to set a level object MemberKeyColumn to the Customer_Number column in table Customer:

LevelObject.MemberKeyColumn = """Customer"".""Customer_Number"""

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


MemberNameColumn

The MemberNameColumn property of the Level interface contains the name of the column that contains member names. This property is useful in situations where the member key column may not contain information recognizable to the user.

For example, a table may contain the columns SKU and Product_Name. When you generate queries by SKU number, you may want to display the corresponding product name for the sake of clarity. In this case, the member key column would be SKU, but the member name column would be Product_Name.

Applies To
clsAggregationLevel | clsDatabaseLevel
clsCubeLevel | clsPartitionLevel

Data Type

String

Access

The access type depends on the level object class.

Class | Access
clsDatabaseLevel | R/W
clsCubeLevel | R
clsPartitionLevel | R
clsAggregationLevel | R

Remarks

MemberNameColumn can be any valid SQL expression involving one or more columns from the table containing the MemberKeyColumn. For example, the following is a valid MemberNameColumn expression for a “Product”.”Prod_Year” member key column:

'Quarter ' & Format(DatePart('q',"""Product"".""Prod_Year"""))

The following is another example from an Employees table:

"""Employees"".""LastName""" & ', '  & """Employees"".""Firstname"""

If MemberNameColumn = "", the server uses MemberKeyColumn values as the member names.

Care should be taken when using MemberNameColumn expressions based on columns other than the columns used by the member key column. Ensure that there is always a one-to-one correspondence in the values produced by the MemberNameColumn and the MemberKeyColumn expressions.

Example

Use the following code to set the MemberNameColumn property of a level object to the Product_Name column in table Sales:

' Assume an object (dsoLev) of ClassType clsLevel exists

dsoLev.MemberNameColumn = """Sales"".""Product_Name"""

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


Name

The Name property of the Level interface contains the name of the level object.

Applies To
clsAggregationLevel | clsDatabaseLevel
clsCubeLevel | clsPartitionLevel

Data Type

String

Access

Read/write (read-only after the object has been named)

Example

Use the following code to return a level object name:

Dim sName As String

sName = LevelObject.Name

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


Ordering

The Ordering property of the Level interface specifies the sequence to use for ordering the members of a level.

Applies To
clsAggregationLevel | clsDatabaseLevel
clsCubeLevel | clsPartitionLevel

Data Type

OrderTypes (an enumeration)

Access

The access type depends on the level object class.

Class | Access
clsDatabaseLevel | R/W
clsCubeLevel | R
clsPartitionLevel | R
clsAggregationLevel | R

Remarks

Specify orderKey to order members in MemberKeyColumn sequence.
Specify orderName to order members in MemberNameColumn sequence.

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


OrdinalPosition

The OrdinalPosition property of the Level interface contains the ordinal position of the level. This is the relative position of this level in the dimension hierarchy, with 1 defining the most aggregated level and the maximum ordinal position being the most detailed level.

The following table shows an example of relative ordinal positions.

Level | Ordinal Position
All | 1
Yearly | 2
Quarterly | 3
Weekly | 4
Daily | 5

Applies To
clsAggregationLevel | clsDatabaseLevel
clsCubeLevel | clsPartitionLevel

Data Type

Integer

Access

Read-only

Example

Use the following code to return a level object ordinal position:

' Assume an object (dsoLev) of ClassType clsLevel exists

If dsoLev.OrdinalPosition = 1 Then

  'Code to handle top level

Else

  'Code to handle remaining levels

End If

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


Parent

The Parent property of the Level interface returns a reference to the parent Dimension object.

Applies To
clsAggregationLevel | clsDatabaseLevel
clsCubeLevel | clsPartitionLevel

Data Type

Dimension

For each level, the class of the parent object depends on the class of the level object.

Level object class | Parent object class
clsDatabaseLevel | clsDatabaseDimension
clsCubeLevel | clsCubeDimension
clsPartitionLevel | clsPartitionDimension
clsAggregationLevel | clsAggregationDimension

Access

Read-only

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


SliceValue

The SliceValue property of the Level interface contains the level slice value. For clsPartitionLevel, if the current level is an All level, it returns the value of property object.MemberNameColumn. For clsAggregationLevel, the slice value of the partition level is returned.

Applies To
clsPartitionLevel

Data Type

String

Access

Read/write

Example

Use the following code to set a level object slice value to the member name “May_Sales”:

' Assume an object (dsoLevel) of ClassType clsCubeLevel exists

dsoLevel.SliceValue = "May_Sales"

Use the following code to return the slice value for a level object:

Dim sSliceVal As String

sSliceVal = LevelObject.SliceValue

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


SubClassType

The SubClassType property of the Level interface contains an enumeration constant identifying the subclass type of the object.

Applies To
clsAggregationLevel | clsDatabaseLevel
clsCubeLevel | clsPartitionLevel

Data Type

SubClassTypes (an enumeration)

Access

Read-only

Remarks

Objects that implement the Level interface, that is, those of ClassType clsCubeLevel, clsDatabaseLevel, or clsPartitionLevel, can have a SubClassType property of sbclsRegular or sbclsVirtual. Objects of ClassType clsAggregationLevel do not support a SubClassType property of sbclsVirtual. For more information, see SubClassTypes in Enumerations.

Example

' Assume an object (dsoLevel) of ClassType clsCubeLevel exists

If dsoLevel.SubClassType = sbclsVirtual Then

  'Code to handle a virtual level

Else

  'Code to handle a regular level

End If

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


MDStore Interface

The MDStore interface is implemented by objects in Microsoft® SQL Server™ OLAP Services Decision Support Objects (DSO) that contain multidimensional data. These are objects are databases, cubes, partitions, and aggregations. They are identified by the value of their ClassType property, which is one of clsDatabase, clsCube, clsPartition, or clsAggregation.

The relationships among these objects are maintained through parent-child linkages using the MDStores collections of each of these objects and the server object. The MDStores collection of a server object contains database objects. Database objects contain cube objects. Cubes contain partitions, and partitions contain aggregations. Together, the MDStore interface and the MDStores collections establish and maintain the hierarchy that defines the structure of OLAP data.

The MDStore interface provides collections, methods, and properties to manipulate these objects, their contained objects, and data. For an overview of database, cube, partition, and aggregation objects and how they relate to each other, see About Decision Support Objects.

The four objects that implement the MDStore interface do not necessarily implement all of the MDStore collections, properties, and methods. Additionally, some MDStore properties and collections may be restricted to read-only access by some objects. For example, an object of ClassType clsDatabase allows read and write access to its DataSources collection whereas access to the DataSources collection of an object of ClassType clsAggregation object is read-only.

Applies To
clsAggregation | clsDatabase
clsCube | clsPartition

Remarks

You create objects that implement the MDStore interface by declaring a variable as an MDStore data type and then creating an instance of the object and adding it to the MDStores collection of another object. The AddNew method of the MDStores collection creates the instance, sets the object’s name to the name you provide, adds the object to the collection, and sets its parent property to reference the owner of the collection. At the same time, the new object’s ClassType is automatically initialized to the appropriate value depending on the object’s parent. For example, if you use the AddNew method to create an object in a cube’s MDStores collection, the new object’s ClassType will be set to clsPartition.

For more information about DSO, see About Decision Support Objects and Interfaces.

Example

The following DSO code creates a server object, connects this object to an OLAP server, and creates database, cube, partition, and aggregation objects in the correct hierarchical structure under the server object:

Dim dsoServer As DSO.Server

' Create a Server object and connect to an OLAP server

Set dsoServer = New DSO.Server

dsoServer.Connect("LocalHost")

' LocalHost causes connection to the OLAP server running

' the same computer as the DSO application

' Create and add a database to the server's MDStores collection

Dim dsoDB As DSO.MDStore

Set dsoDB = dsoServer.MDStores.AddNew("MyDatabase")

'... additional code to set other database object properties

' Create and add a cube to the database’s MDStores collection

Dim dsoCube As DSO.MDStore

dsoCube = dsoDB.MDStores.AddNew("MyCube")

'... additional code to set other cube properties

' Create and add a partition to the cube's MDStores collection

Dim dsoPart As DSO.Partition

Set dsoPart = dsoCube.MDStores.AddNew("MyPartition")

'... additional code to set other partition properties

' Create and add an aggregation to the partition's MDStores collection

Dim dsoAgg As DSO.MDStore

Set dsoAgg = dsoPart.MDStores.AddNew("MyAggregation")

'... additional code to set other aggregation properties


Collections, MDStore Interface

The MDStore interface supports the following collections.

Collection | Description
Commands | Collection of user-defined commands or sequence of commands.
CustomProperties | Collection of user-defined properties.
DataSources | Collection of objects specifying a data provider.
Dimensions | Collection that holds the dimension definitions for an object.
MDStores | Collection that holds MDStore objects.
Measures | Collection that holds the measures.
Roles | Collection that holds the user role definitions for Cube and Database objects.

The following table shows the class types of the objects each collection can contain.

Collection | Class type of contained objects
Commands | clsCubeCommand clsDatabaseCommand
CustomProperties | Property
DataSources | clsDatasource
Dimensions | clsAggregationDimension clsCubeDimension clsDatabaseDimension clsPartitionDimension
MDStores | clsAggregation clsCube clsDatabase clsPartition
Measures | clsAggregationMeasure clsCubeMeasure clsPartitionMeasure
Roles | clsCubeRole clsDatabaseRole

Access Cross-Reference

The following table shows whether a collection is read/write (R/W), read-only (R), or not applicable (n/a) for each of the MDStore objects.

Collection | clsDatabase | clsCube | clsPartition | clsAggregation
Commands | R/W | R/W | n/a | n/a
Custom Properties | R/W | R/W | R/W | R/W
DataSources | R/W | R/W* | R/W | n/a
Dimensions | R/W | R/W | R | R
MDStores | R/W | R/W | R/W | R
Measures | n/a | R/W | R | R
Roles | R/W | R/W | n/a | n/a
*This property is not applicable (n/a) for virtual cubes (that is, those of SubClassType sbclsVirtual).


Methods, MDStore Interface

The MDStore interface supports the following methods.

Method | Description
BeginTrans | Begins a transaction on a database.
Clone | Creates and returns a copy of an MDStore object.
CommitTrans | Commits a transaction.
LockObject | Locks an object.
Merge | Merges two partitions.
Process | Processes an MDStore object.
Rollback | Rolls back a transaction.
UnlockObject | Unlocks a previously locked object.
Update | Updates the definition of an object in the metadata repository.

Method/Class Cross-Reference

The following table shows the implementation of methods by object. X indicates applicable, n/a indicates not applicable.

Method | Database | Cube | Partition | Aggregation
BeginTrans | X | n/a | n/a | n/a
Clone | X | X | X | X
CommitTrans | X | n/a | n/a | n/a
LockObject | X | X | X | n/a
Merge | n/a | n/a | X | n/a
Process | X | X | X | n/a
Rollback | X | n/a | n/a | n/a
UnlockObject | X | X | X | n/a
Update | X | X | X | n/a


BeginTrans

The BeginTrans method of the MDStore interface initiates a transaction on the OLAP server database.

Transactions group the processing of objects on the OLAP server that you specify with the Process method for Database, Cube, Partition, or Dimension objects. Processing actions within a transaction are not initiated on the server until you execute the CommitTrans method. You can use the Rollback method to void a transaction and leave the state of the objects on the server in the same condition as they were before the transaction was initiated. The processing of all objects on which you execute the Process method within the same transaction is completed as a single atomic operation - all of the specified processing is completed if the transaction completes successfully, or none of it is completed if you roll back the transaction or it terminates abnormally.

If you invoke a Process method on an object without first explicitly beginning a transaction, Decision Support Objects (DSO) creates a single transaction for you so that the object you are processing is always processed inside a transaction.

Applies To
clsDatabase

Syntax

object.BeginTrans

object
The Database object to which changes are to be applied.
See Also
About Decision Support Objects | Using Decision Support Objects
CommitTrans | Rollback
Methods Cross-Reference |


Clone

The Clone method of the MDStore interface copies the property values and optionally the collections of major and minor objects of an existing object to a target object of the same class type.

Applies To
clsAggregation | clsDatabase
clsCube | clsPartition

Syntax

object.Clone(TargetObject [, CloneOptions])

object
The MDStore object whose property values and collections of major and minor objects are to be copied.
TargetObject
An existing MDStore object.
CloneOptions
One of values of the CloneOptions enumeration.

The options to tell the method the extent to which the source object’s properties and major or minor children should be copied.

Option | Description
cloneObjectProperties | The values of the properties of the source object will be copied to the target object.
cloneMinorChildren | The values of the properties and the minor objects contained in the source object’s collections are copied. For example, for a cube, the dimensions and their levels, measures, commands, and roles are copied. The target cube will have a default partition, but its properties are not based on the source cube’s default partition.
cloneMajorChildren | The values of all properties and major and minor objects contained in the source object’s collections are copied. This is the default operation for the Clone method.

See Also
About Decision Support Objects | Using Decision Support Objects
Methods Cross-Reference |


CommitTrans

The CommitTrans method of the MDStore interface commits a transaction previously initiated by the BeginTrans method on a Database object.

Applies To
clsDatabase

Syntax

object.CommitTrans

object
The Database object associated with the transaction.
See Also
BeginTrans | Rollback
About Decision Support Objects | Using Decision Support Objects
Methods Cross-Reference |


LockObject

The LockObject method of the MDStore interface locks an object to prevent actions of multiple users of the object from colliding.

Applies To
clsCube | clsPartition
clsDatabase |

Syntax

object.LockObject(LockType, LockDescription)

object
The object to lock.
LockType
One of the lock types of the OlapLockTypes enumeration.
LockDescription
A string containing a description of the lock, available to other applications attempting to obtain a lock.
Remarks

There are four types of locks defined by the OlapLockTypes enumeration: olapLockExtendedRead, olapLockProcess, olapLockRead, and olapLockWrite.

olapLockExtendedRead
The object’s properties can be read by other applications, but cannot be changed or processed. This lock is used to prevent processing of dependent objects of an object that is being processed, such as dimensions that are shared by multiple cubes. Multiple olapLockExtendedRead locks may be applied to an object by multiple applications. However, no application can lock the object for processing or updating until all olapLockExtendedRead locks have been released.
olapLockProcess
The object’s Process method can be initiated, and other applications can only read the object’s properties only until the lock is released. Only one olapLockProcess lock can be applied to an object at a time, and other applications can apply olapLockRead locks only while the olapLockProcess lock is in place.
olapLockRead
The properties of the object can be read from the repository and cannot be changed by another application until the lock is released. Other applications can issue olapLockRead, olapLockExtendedRead, and olapLockProcess locks, but not olapLockWrite locks, while the initial olapLockRead lock is in place.
olapLockWrite
The properties of the object can be modified in the repository using the Update method, and are not available to other applications for any use until the lock is released. No other locks of any type can be applied to the object until the olapLockWrite lock is released.

When two applications (App1 and App2) are accessing the same object, the following table defines the actions available to App2 depending on the lock type obtained by App1.

 | App2 can obtain lock |  |  |
App1 lock obtained | olapLockRead | olapLock ExtendedRead | olapLock Process | olapLockWrite
olapLockRead | Yes | Yes | Yes | No
olapLock ExtendedRead | Yes | Yes | No | No
olapLock Process | Yes | No | No | No
olapLockWrite | No | No | No | No

See Also
About Decision Support Objects | Using Decision Support Objects
UnlockObject | Methods Cross-Reference


Merge

The Merge method of the MDStore interface merges two partitions into a single partition. The partitions must have the same aggregations and storage modes.

Applies To
clsPartition

Syntax

partition.Merge(SourceName)

partition
The partition object into which to merge the source partition object.
SourceName
A string that contains the name of the source partition object.
Remarks

Before merging two partitions that specify data slices, you must first set the slice of the receiving partition to the slice that will apply after the merge is complete. Otherwise the partitions will not be successfully merged. The slice for the receiving partition must be the parent of the first level where the slice values for the two partitions differ.

For example, if you are merging a partition that contains data based on the slice [AllTime].[1998].[Quarter2] into a partition that contains [AllTime].[1998].[Quarter1], the target partition’s slice must be set to the parent of the two slices that differ, in this case [AllTime].[1998]. The target partition’s slice must be set to this value before merging the partitions. For more information, see Partitions and Merging Partitions.

Note This adjustment is done automatically when you merge partitions using the OLAP Manager user interface.

Example

' This example code merges the data slices of two partitions

' This subroutine does not merge the partitions

Sub MergeDataSlices(SourcePart As DSO.MDStore, _

    TargetPart As DSO.MDStore)

' Change the slice of the target partition

' Use the least common denominator of the two partitions

Dim spart_dim As DSO.Dimension

Dim spart_lev As DSO.Level

Dim tpart_dim As DSO.Dimension

Dim tpart_lev As DSO.Level

Dim nDim As Integer

Dim nLev As Integer

Dim nLev2 As Integer

' Search for the first level where the slice differs

' Then use the parent level just above it

For nDim = 1 To SourcePart.Dimensions.Count

  Set spart_dim = SourcePart.Dimensions(nDim)

  Set tpart_dim = targetPart.Dimensions(nDim)

  For nLev = 1 To spart_dim.Levels.Count

    Set spart_lev = spart_dim.Levels(nLev)

    Set tpart_lev = tpart_dim.Levels(nLev)

    If spart_lev.SliceValue <> tpart_lev.SliceValue Then

      ' Clear the slice values for all of the levels below

      ' in the target partition

      For nLev2 = nLev To spart_dim.Levels.Count

        Set tpart_lev = tpart_dim.Levels(nLev2)

        tpart_lev.SliceValue = ""

      Next

      Exit For

    End If

  Next

Next

targetPart.Update

Exit Sub

End Sub

See Also
About Decision Support Objects | Using Decision Support Objects
Methods Cross-Reference |


Process

The Process method of the MDStore interface creates and populates an MDStore object on the OLAP server. Databases, cubes, and partitions can be processed. Processing each of these objects means that all subordinate objects are processed. For example, invoking the Process method for a database processes all of the associated dimensions and cubes. For a complete discussion of processing and the differences between processing and updating, see Updating OLAP Data, Processing Cubes, and Processing Dimensions.

Applies To
clsDatabase | clsCube
clsPartition |

Syntax

object.Process[(option)]

object
The MDStore object to process.
option
An optional parameter specifying one of the values enumerated by the ProcessTypes enumerator.
Remarks

Processing an MDStore object causes the OLAP server to read source data, perform calculations, and store aggregated data. For example, processing an object of ClassType clsCube causes the server to read all source data corresponding to the definition of the cube and to create the resulting multidimensional cube of data. If you use the Process method on a Database object, all cubes and dimensions in the database are processed. Processing a cube automatically causes the processing of all subordinate partitions. In addition, any of the cube’s dimensions whose State property is not olapStateCurrent will also be processed, including shared dimensions.

Processing a cube whose SubClassType is sbclsVirtual causes cubes used by the virtual cube to be processed only if their State is not olapStateCurrent.

See Also
About Decision Support Objects | Using Decision Support Objects
Methods Cross-Reference |


Rollback

The Rollback method of the MDStore interface rolls back a transaction on a database. All changes made to the object subsequent to the initiation of the transaction with the BeginTrans method are voided and the object remains in the state it was at the time of the beginning of the transaction.

Applies To
clsDatabase

Syntax

object.Rollback

object
The Database object on which to roll back the transaction.
See Also
BeginTrans | CommitTrans
About Decision Support Objects | Using Decision Support Objects
Methods Cross-Reference |


UnlockObject

The UnlockObject method of the MDStore interface releases a lock on an MDStore object previously established by the LockObject method.

Applies To
clsCube | clsPartition
clsDatabase |

Syntax

object.UnlockObject

object
The MDStore object to unlock.
Remarks

For a complete list of lock types, see Enumerations.

See Also
About Decision Support Objects | Using Decision Support Objects
LockObject | Methods Cross-Reference


Update

The Update method of the MDStore interface updates the definition of an MDStore object in the metadata repository. Changes made to the values of an object’s properties are not saved to the repository until the object’s Update method is executed.

Applies To
clsCube | clsPartition
clsDatabase |

Syntax

object.Update

object
The MDStore object to be updated.
Remarks

The Update method has no effect on an object whose IsTemporary property is set to True.

See Also
About Decision Support Objects | Using Decision Support Objects
Methods Cross-Reference |


Properties, MDStore Interface

The MDStore interface supports the following properties.

Property | Description
AggregationPrefix | Prefix associated with an aggregation in the store.
Analyzer | Analyzer object for the store.
ClassType | Returns an enumeration constant identifying the specific object type.
Description | Description of the store.
EstimatedRows | Estimated number of rows in the store.
EstimatedSize | Estimated size of all rows, in bytes, in the store.
FromClause | A comma-separated list of the tables from which the store data is obtained.
IsDefault | Indicates whether the store is the default store.
IsReadWrite | Indicates whether the MDStore object is writable.
IsTemporary | Indicates whether the object is temporary.
IsValid | Indicates whether the store object is valid.
JoinClause | A list of join conditions separated by AND.
LastProcessed | Date and time a store was last processed.
LastUpdated | User-defined date. Not used by OLAP Services.
Name | Name of the store.
OlapMode | Returns an enumeration constant identifying the type of OLAP mode of the store.
Parent | Returns a reference to the parent MDStore object.
Server | Returns a reference to the DSO.Server object.
SourceTable | Name of the source table for the store.
SourceTableFilter | SQL statement that specifies the source table records to included in the store.
State | Returns an enumeration constant indicating the difference between the MDStore object referenced by the client application and the corresponding MDStore object on the OLAP server.
SubClassType | Returns an enumeration constant identifying the subclass type of the object.

Property Cross-Reference

The following table shows whether the property is read/write (R/W), read-only (R), or not applicable (n/a) for different objects.

Property | Database | Cube | Partition | Aggregation
AggregationPrefix | R | R/W | R/W | R
Analyzer | n/a | R* | R | n/a
ClassType | R | R | R | R
Description | R/W | R/W | R/W | R/W
Estimated Rows | n/a | R/W** | R/W | R/W
Estimated Size | R | R | R | R
FromClause | n/a | R/W* | R/W | R/W
IsDefault | n/a | n/a | R | R/W
IsReadWrite | R | R | R/W | n/a
IsTemporary | n/a | R | R | R
IsValid | R | R | R | R
JoinClause | n/a | R/W* | R/W | R/W
Last Processed | R | R | R | R
LastUpdated | R/W | R/W | R/W | R
Name | R/W (R after the object has been named) | R/W (R after the object has been named) | R/W (R after the object has been named) | R/W (R after the object has been named)
OlapMode | R/W | R/W* | R/W | R/W
Parent | R | R | R | R
Server | R | R | R | R
SourceTable | n/a | R/W* | R/W | R/W
SourceTableFilter | n/a | R/W* | R/W | n/a
State | R | R | R | n/a
SubClassType | R | R | R | R
* This property is not applicable (n/a) for virtual cubes (that is, those of SubClassType sbclsVirtual).
** This property is read-only (R) for virtual cubes (that is, those of SubClassType sbclsVirtual).


AggregationPrefix

The AggregationPrefix property of the MDStore interface contains the prefix associated with an aggregation in an MDStore object.

Applies To
clsAggregation | clsDatabase
clsCube | clsPartition

Aggregation prefixes are used to generate aggregation names, and are used for table names in the relational database.

A fully-expanded aggregation name has four parts:

<DatabasePrefix><CubePrefix><PartitionPrefix><AggregationID>

The first three parts of the name are user-provided and make up the aggregation prefix; the fourth part of the name is a system-defined ID over which users have no control. The first two prefixes (DatabasePrefix and CubePrefix) are optional. CubePrefix is used only if PartitionPrefix begins with “+”, and DatabasePrefix is used only if CubePrefix begins with “+”. For example, if PartitionPrefix is “+_Partition1”, CubePrefix is “+_1995”, and DatabasePrefix is “Sales”, the aggregation prefix is “Sales_1995_Partition1”.

Data Type

String

Values
Range
Cannot exceed 22 characters (exclusive of any plus signs).
Default

Class | Default Value
clsDatabase | None.
clsCube | None.
clsPartition | If not provided by user, a unique name is derived from the parent cube name and partition name.
clsAggregation | Parent partition’s name

Access

Access to an aggregation prefix depends on the class of the associated MDStore object.

MDStore object class type | Access
clsCube | R/W
clsDatabase | R
clsPartition | R/W
clsAggregation | R


Analyzer

The Analyzer property of the MDStore interface contains a reference to the analyzer object associated with an MDStore object. The system automatically associates one analyzer (and only one) with an MDStore object.

Applies To
clsCube
(excluding virtual cubes) 		clsPartition

Data Type

The data type depends on the class type of the associated MDStore object.

MDStore object class type | Data Type
clsCube | clsCubeAnalyzer
clsPartition | clsPartitionAnalyzer

Access

Read-only

Remarks

For more information, see clsCubeAnalyzer and clsPartitionAnalyzer.

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


ClassType

The ClassType property of the MDStore interface contains an enumeration constant identifying the specific class type.

Applies To
clsAggregation | clsDatabase
clsCube | clsPartition

Data Type

ClassTypes (an enumeration)

Values
Range
clsAggregation, clsCube, clsDatabase, or clsPartition
Default
Established when object is created
Access

Read-only

Remarks

All objects in Decision Support Objects (DSO) have a ClassType and a SubClassType property. The SubClassType property uses one of the enumerated values sbclsRegular and sbclsVirtual to identify the object as either regular or virtual. For a complete list of class types and subclass types, see Enumerations.

See Also
About Decision Support Objects | Using Decision Support Objects
SubClassType | Properties Cross-Reference


Description

The Description property of the MDStore interface contains a user-supplied description of the MDStore object or its contents.

Applies To
clsAggregation | clsDatabase
clsCube | clsPartition

Data Type

String

Values
Range
50 characters
Default
None
Access

Read/write

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


EstimatedRows

The EstimatedRows property of the MDStore interface contains the estimated number of rows in the MDStore object. This property value is used in the algorithm that designs aggregations.

Applies To
clsAggregation | clsPartition
clsCube |

Data Type

Double

Values
Range
Value as type Double
Default
Zero
Access

Read/write

Remarks

The interpretation of the estimated value depends on the class type of the associated MDStore object.

MDStore object class type | Interpretation of estimated value
clsCube | Number of rows in the fact table of the cube.
clsCube (virtual) | Sum of number of rows in the underlying cubes.
clsPartition | Number of rows in the fact table of the parent cube.
clsAggregation | Number of rows in the aggregation table.

See Also
About Decision Support Objects | Using Decision Support Objects
EstimatedSize | Properties Cross-Reference


EstimatedSize

The EstimatedSize property of the MDStore interface contains the estimated size, in bytes, of all the rows in the MDStore object.

Note The EstimatedSize property for a ROLAP cube does not include the size of the tables in the relational database. For a HOLAP cube, the EstimatedSize property does not include the size of the fact table. For more information, see Storage Modes (MOLAP, ROLAP, HOLAP).

Applies To
clsAggregation | clsDatabase
clsCube | clsPartition

Data Type

Double

Values
Range
Value as type Double
Access

Read-only

Remarks

The EstimatedSize property is valid after an object is processed. The interpretation of the estimated value depends on the class type of the associated MDStore object.

MDStore object class type | Interpretation of estimated value
clsCube | The size of the cube data and aggregations.
clsPartition | The size of the partition.
clsCube (virtual) | The size of the virtual cube.
clsAggregation | The size of the aggregation table.

See Also
About Decision Support Objects | Using Decision Support Objects
EstimatedRows | Properties Cross-Reference


FromClause

The FromClause property of the MDStore interface contains a comma-separated list of the fact table and the dimension tables from which store data is obtained. For example, “tblFacts”, “tblProduct”, “tblCustomer”.

Note You must delimit the table and column names with the delimiters appropriate to the source database. You can use the CloseQuoteChar and OpenQuoteChar properties of the Datasource object to determine the correct delimiters.

Applies To
clsAggregation | clsPartition
clsCube(excluding virtual cubes) |

Data Type

String

Values
Default
Empty string
Access

Read/write

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


IsDefault

The IsDefault property of the MDStore interface indicates whether an MDStore object is the default partition of a cube or the default aggregation of a partition.

Applies To
clsAggregation clsPartition

Data Type

Boolean

Values
Default
The default value depends on the class type of the associated MDStore object.

MDStore object class type | Default value
clsPartition | True if the partition is the only one in the cube; False otherwise.
clsAggregation If you generate the aggregation by using an object of ClassType clsPartitionAnalyzer, the system automatically sets IsDefault to True. Generating aggregations in this way has performance benefits, and it is the recommended method for generating aggregations.

If you generate the aggregation without using a PartitionAnalyzer object, you should set IsDefault to False.

Access

Access depends on the class type of the associated MDStore object.

MDStore object class type | Access
clsPartition | R
clsAggregation | R/W

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


IsReadWrite

The IsReadWrite property of the MDStore interface indicates whether the MDStore object is read-only or read/write enabled.

Applies To
clsCube | clsPartition
clsDatabase |

Data Type

Boolean

Access

Access depends on the class type of the associated MDStore object.

MDStore object class type | Access
clsDatabase | R
clsCube | R
clsPartition | R/W

Remarks

The IsReadWrite property for objects of ClassType clsCube is True if the cube’s associated partition is a write-back partition and its IsReadWrite property is True. The IsReadWrite property for objects of ClassType clsDatabase is True if one of the database’s associated cubes is read-write.

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


IsTemporary

The IsTemporary property of the MDStore interface indicates whether an object is temporary. Temporary objects are local to the session in which they are created, cannot be saved, and are not available to other users. To create a temporary object, preface the name with the tilde (~) character.

Applies To
clsAggregation | clsPartition
clsCube |

Data Type

Boolean

Access

Read-only

Remarks

A temporary object is not stored in the repository and is not available to other users. Temporary objects persist only during the session in which they are created unless renamed or cloned to another existing object having the same class type. Objects subordinate to a temporary object, such as levels for a dimension, internally inherit the parent object’s IsTemporary setting.

Note Only temporary objects can be renamed by changing the Name property. Omitting the tilde (~) character from the name of a temporary object means that it is no longer temporary and prevents any subsequent renaming of the object. Also, executing the Update method of a temporary object has no effect; the object will not be saved to the repository until the tilde prefix is removed by changing the Name property.

Example

'Assume an object (dsoCube) of ClassType clsCube exists

Dim tmpDim As DSO.Dimension

Set tmpDim = dsoCube.Dimensions.AddNew("~MyDim") 'Temporary

'Add levels, member properties, process, etc.

...

'This is something we want to keep - so drop "~"

tmpDim.Name = "MyDim" 'No longer temporary

tmpCube.Update

See Also
About Decision Support Objects | Using Decision Support Objects
Dimension Interface | Properties Cross-Reference


IsValid

The IsValid property of the MDStore interface indicates whether the MDStore object is valid.

Applies To
clsAggregation | clsDatabase
clsCube | clsPartition

Data Type

Boolean

Access

Read-only

Remarks

What gets validated depends on the class type of the associated MDStore object.

MDStore object class type | What gets validated
clsDatabase | The cubes, virtual cubes, dimensions, roles, and commands of the database.
clsCube | The measures, dimensions, data source, and fact table of the cube.
clsPartition | The measures, dimensions, fact table, and aggregation prefix of the partition.
clsAggregation | The name, parent, and prefix of the aggregation.

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


JoinClause

The JoinClause property of the MDStore interface contains the list of join conditions currently defined for an MDStore object. The conditions are separated by AND, for example, “FactTable”.”CustomerId”=“CustTable”.”CustomerId” AND “FactTable”.”ProductId”=“ProductTable”.”SKU”.

Note You must delimit the table and column names with the delimiters appropriate to the source database. You can use the CloseQuoteChar and OpenQuoteChar properties of the Datasource object to determine the correct delimiters.

Applies To
clsAggregation | clsPartition
clsCube (excluding virtual cubes) |

Data Type

String

Values
Range
No limitation.
Default
Empty string.
Access

Read/write

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


LastProcessed

The LastProcessed property of the MDStore interface contains the date and time when an MDStore object was last processed.

Applies To
clsAggregation | clsDatabase
clsCube | clsPartition

Data Type

Date

Values
Range
Valid date/time value
Default
n/a
Access

Read-only

Remarks

The LastProcessed property for an object is undefined and will raise an error if you attempt to read it when the value of the object’s State property is olapStateNeverProcessed. For more information, see State.

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


LastUpdated

The LastUpdated property of the MDStore interface is not used by OLAP Services. You can set this to any date/time value you want, for instance, to indicate when the source data was last changed.

Applies To
clsAggregation | clsDatabase
clsCube | clsPartition

Data Type

Date

Access

Access depends on the class of the associated MDStore object.

Class | Access
clsDatabase | R/W
clsCube | R/W
clsPartition | R/W
clsAggregation | R

Remarks

Except for aggregation objects, which inherit the value of this property from their parents, the LastUpdated property is not automatically set by any method in the Decision Support Objects (DSO) object model. It is provided as a means for client applications to specify a date or time that represents the validity of information. For example, a date of 12/31/97 may mean that the information stored in a cube is not valid after December of 1997.

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


Name

The Name property of the MDStore interface contains the name of the MDStore object.

Applies To
clsAggregation | clsDatabase
clsCube | clsPartition

Data Type

String

Values
Range
Maximum length is 50 characters.
Default
none
Access

Read/write (read-only after the object has been named)

Remarks

The primary mechanism for identifying an MDStore object is the Name property. You specify an object’s name when you create the object. Except for temporary objects, you cannot rename an object after it has been created.

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


OlapMode

The OlapMode property of the MDStore interface contains the OLAP storage mode assigned to the MDStore object.

Applies To
clsAggregation | clsDatabase
clsCube (excluding virtual cubes) | clsPartition

Data Type

OlapStorageModes (an enumeration)

Values
Range
Any of the values returned by the OlapStorageModes enumerator.

The OlapMode property defines the storage mode for each fact table and aggregation in an MDStore object. The possible storage modes are ROLAP and MOLAP. The term HOLAP storage refers to a combination of ROLAP and MOLAP storage modes.

Default
The value of Db.OlapMode is the default OlapMode for new cubes created in the database. Cube.OlapMode is the default OlapMode for new partitions created within the cube. Partition.OlapMode is the OlapMode of that partition and Aggregation.OlapMode is the OlapMode of that aggregation.
Access

Read/write

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


Parent

The Parent property of the MDStore interface contains a reference to the parent of the MDStore object. For example, an object of ClassType clsDatabase has an MDStores collection that contains objects of ClassType clsCube. The object of ClassType clsDatabase is the parent of these objects.

Applies To
clsAggregation | clsDatabase
clsCube | clsPartition

Data Type

MDStore

MDStore object class type | Parent object class type
clsDatabase | clsServer
clsCube | clsDatabase
clsPartition | clsCube
clsAggregation | clsPartition

Access

Read-only

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


Server

The Server property of the MDStore interface contains a reference to the DSO.Server object that is the ancestor of the object.

Applies To
clsAggregation | clsDatabase
clsCube | clsPartition

Data Type

DSO.Server

Values
Default
None
Access

Read-only

Remarks

You can use this property to access the methods and properties of the server object. For example, you can check the edition of the installed OLAP Services or the state of the OLAP server, create objects, and so on.

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


SourceTable

The SourceTable property of the MDStore interface contains the name of the fact table associated with the MDStore object.

Applies To
clsAggregation | clsPartition
clsCube (excluding virtual cubes) |

Data Type

String

Values
Default
none
Access

Read/write

See Also
About Decision Support Objects | Using Decision Support Objects
SourceTableFilter | Properties Cross-Reference


SourceTableFilter

The SourceTableFilter property of the MDStore interface contains the WHERE clause of an SQL statement, without the WHERE keyword, used to determine which fact table records are to be included in the MDStore object. The statement can contain multiple conditions. For example:

"time_by_day"."the_year" = '1997' AND "product"."product_id" = 'soap'

Note You must delimit the table and column names with the delimiters appropriate to the source database. You can use the CloseQuoteChar and OpenQuoteChar properties of the DataSource object to determine the correct delimiters.

Applies To
clsCube
(excluding virtual cubes) 		clsPartition

Data Type

String

Values
Range
No maximum length
Default
None
Access

Read/write

See Also
About Decision Support Objects | Using Decision Support Objects
SourceTable | Properties Cross-Reference


State

The State property of the MDStore interface returns an enumeration constant indicating the processing state of the object on the server represented by the Decision Support Objects (DSO) MDStore object.

Applies To
clsCube | clsPartition
clsDatabase |

Data Type

OlapStateTypes (an enumeration)

Values

The value of the State property depends on the value of the class type of the associated MDStore object.

MDStore object class type | State
clsDatabase | olapStateNeverProcessed olapStateCurrent
clsCube | olapStateNeverProcessed olapStateStructureChanged olapStateCurrent
clsPartition | All states apply

Range
  • olapStateNeverProcessed
  • olapStateStructureChanged
  • olapStateSourceMappingChanged
  • olapStateCurrent
Default
olapStateNeverProcessed
Access

Read-only

Remarks

The State property indicates the current status of an MDStore object and is used to determine if processing of the object is required. For more information, see OlapStateTypes in Enumerations.

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


SubClassType

The SubClassType property of the MDStore interface contains the enumeration constant identifying the subclass type of the object.

Applies To
clsAggregation | clsDatabase
clsCube | clsPartition

Data Type

SubClassTypes (an enumeration)

Access

Read-only

Remarks

Objects that implement the MDStore interface, that is, those of ClassType clsAggregation, clsCube, clsDatabase, or clsPartition, can have a SubClassType property value of sbclsRegular. An object of ClassType clsCube can also be of SubClassType sbclsVirtual. For more information, see SubClassTypes in Enumerations.

Example

'Assume an object (dsoCube) of ClassType clsCube exists

If dsoCube.SubClassType = sbclsVirtual Then

    'Code to handle a virtual cube

Else

    'Code to handle a regular cube

End If

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


Measure Interface

Measures are the quantitative, numerical columns from the fact table of a cube. When a cube is processed, the measures are aggregated across the dimensions in the cube. For example, a database contains the following tables:

  • Sales_Facts
  • Customer
  • Product
  • Promotion
  • Product_Class
  • Store
  • Calendar

The following diagram illustrates the relationships of these tables.

The Sales_Facts table is the cube fact table and the related tables are the cube dimensions. The Sales_Quantity, Unit_Price, and Unit_Cost rows are measures that can be aggregated across dimensions such as Store, Customer, or Product.

In Decision Support Objects (DSO), the objects that implement the Measure interface have a ClassType property value of clsAggregationMeasure, clsCubeMeasure, or clsPartitionMeasure. These objects serve as containers for measure objects within each respective parent object. The Measure interface provides a number of properties and methods to manipulate these objects. For an overview of cube, partition, and aggregation objects and how they relate to each other, see About Decision Support Objects.

Each of these objects implements the Measure interface, but not necessarily all of the Measure properties. Some Measure properties may be restricted to read-only access by some objects. For example, a clsCubeMeasure object allows read and write access to its FormatString property whereas access to this property for any other measure object is read-only. The collections and properties of the Measure interface also apply to the measures of virtual cubes, although no special class is implemented for virtual cube measures. There are no methods associated with the Measure interface.

For more information about the Measure interface collections and properties and their applicability to the associated objects, see Collections and Properties.

Applies To
clsAggregationMeasure | clsPartitionMeasure
clsCubeMeasure |


Collections, Measure Interface

The Measure interface supports the following collection.

Collection | Description
CustomProperties | Collection of user-defined properties.

Applies To
clsAggregationMeasure | clsPartitionMeasure
clsCubeMeasure |

Access

Read/write


Properties, Measure Interface

The Measure interface supports the following properties.

Property | Description
AggregateFunction | Sets or returns a value corresponding to the type of aggregation function used for a measure.
ClassType | Returns an enumeration constant identifying the specific object type.
Description | Sets or returns the measure description.
FormatString | Sets or returns the format used to display the measure values.
IsInternal | Indicates whether the measure is internal to the cube, that is, it is used only for calculations of other measures.
IsValid | Indicates whether the measure object is valid.
Name | Sets or returns the measure name.
OrdinalPosition | Returns the ordinal position of the measure in the parent object’s Measures collection.
Parent | Returns a reference to the parent MDStore object.
SourceColumn | Sets or returns the name of the column in the measure fact table that is aggregated.
SourceColumnType | Sets or returns the measure source column data type.
SubClassType | Returns an enumeration constant identifying the subclass type of the object.

Access Cross-Reference

The following table shows whether the property is read/write (R/W) or read-only (R) for different objects.

Property | clsCube Measure | clsPartition Measure | clsAggregation Measure
AggregateFunction | R/W* | R | R
ClassType | R | R | R
Description | R/W | R | R
FormatString | R/W* | R | R
IsInternal | R/W* | R | R
IsValid | R | R | R
Name | R/W (R after the object has been named) | R/W (R after the object has been named) | R/W (R after the object has been named)
OrdinalPosition | R | R | R
Parent | R | R | R
SourceColumn | R/W | R/W | R
SourceColumnType | R/W* | R | R
SubClassType | R | R | R

* This property is read-only (R) for virtual cubes (that is, those of SubClassType sbclsVirtual).


AggregateFunction

The AggregateFunction property of the Measure interface contains a value that corresponds to the type of aggregation function used to calculate the aggregated value of the measure.

Applies To
clsAggregationMeasure | clsPartitionMeasure
clsCubeMeasure |

Data Type

AggregatesTypes (an enumeration)

AggregateType is set to one of the following:

  • aggSum
  • aggCount
  • aggMin
  • aggMax

To create more sophisticated measures (for example, ratios or statistical functions), use the command objects. For more information, see clsCubeCommand and clsDatabaseCommand.

Access

The access type depends on the measure object class.

Class | Access
clsCubeMeasure | R/W
clsCubeMeasure (virtual) | R
clsPartitionMeasure | R
clsAggregationMeasure | R

Example

Use the following code to specify an aggregation COUNT function for a cube measure object:

'Assume an object (dsoAggMea) of ClassType clsAggregationMeasure exists

dsoAggMea.AggregateFunction = aggCount

...

Dim AggType As AggregatesTypes

AggType = dsoAggMea.AggregateFunction

Select Case AggType

    Case aggSum

       'commands for aggregation summation

    Case aggCount

       'commands for aggregation counts

    Case aggMin

       'commands for aggregation min

    Case aggMax

       'commands for aggregation max

End Select

See Also
About Decision Support Objects | Using Decision Support Objects
AggregatesTypes |


ClassType

The ClassType property of the Measure interface returns an enumeration constant identifying the specific object type.

Applies To
clsAggregationMeasure | clsPartitionMeasure
clsCubeMeasure |

Data Type

ClassTypes (an enumeration)

For measure objects, ClassType is set to one of the following values:

  • clsCubeMeasure
  • clsPartitionMeasure
  • clsAggregationMeasure

For a complete list of class types, see Enumerations.

Access

Read-only

Example

Use the following code to return the class type of a measure object and determine which object class has been returned:

'Assume an object (dsoCubeMea) of ClassType clsCubeMeasure exists

Select Case dsoCubeMea.ClassType

Case clsCubeMeasure

        ' commands for a CubeMeasure

Case clsPartitionMeasure

        ' commands for a PartitionMeasure

   Case clsAggregationMeasure

        ' commands for an AggregationMeasure

   Case Else

        ' other commands

End Select

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference | Enumerations


Description

The Description property of the Measure interface contains the measure description.

Applies To
clsAggregationMeasure | clsPartitionMeasure
clsCubeMeasure |

Data Type

String

Access

The access type depends on the class of the measure object.

Class | Access
clsCubeMeasure | R/W
clsPartitionMeasure | R
clsAggregationMeasure | R

Remarks

The primary mechanism for identifying the data in a measure is the Name property. The purpose of the Description property is to provide additional descriptive information.

Example

Use the following code to set the measure object's description:

'Assume an object (dsoCubeMea) of ClassType clsCubeMeasure exists

dsoCubeMea.Description = "Extended price"

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


FormatString

The FormatString property of the Measure interface contains the format used to display the measure values. Any valid Microsoft® Visual Basic® style format strings are acceptable.

Applies To
clsAggregationMeasure | clsPartitionMeasure
clsCubeMeasure |

Data Type

String

Access

The access type depends on the measure object's class.

Class | Access
clsCubeMeasure | R/W
clsCubeMeasure (virtual) | R
clsPartitionMeasure | R
clsAggregationMeasure | R

Example

Use the following code to set the measure object [Sales_Facts].[Quantity] format string:

'Assume an object (dsoCubeMea) of ClassType clsCubeMeasure exists

dsoCubeMea.FormatString = "#,###.##"

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


IsInternal

The IsInternal property of the Measure interface indicates whether the measure is internal to the cube, that is, it is used only for calculations of other measures and is not visible to the users of the cube.

Applies To
clsAggregationMeasure | clsPartitionMeasure
clsCubeMeasure |

Data Type

Boolean

Access

The access type depends on the measure object’s class.

Class | Access
clsCubeMeasure | R/W
clsCubeMeasure (virtual) | R
clsPartitionMeasure | R
clsAggregationMeasure | R

Example

Use the following code to define a measure object as internal only:

'Assume an object (dsoCubeMea) of ClassType clsCubeMeasure exists

dsoCubeMea.IsInternal = True

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


IsValid

The IsValid property of the Measure interface indicates whether the measure structure is valid.

Applies To
clsAggregationMeasure | clsPartitionMeasure
clsCubeMeasure |

Data Type

Boolean

Access

Read-only

Example

Use the following code to return a measure object’s validity status:

'Assume an object (dsoCubeMea) of ClassType clsCubeMeasure exists

Dim bValid As Boolean

bValid = dsoCube.IsValid

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


Name

The Name property of the Measure interface contains the measure object’s name.

Applies To
clsAggregationMeasure | clsPartitionMeasure
clsCubeMeasure |

Data Type

String

Access

Read/write (read-only after the object has been named)

Remarks

The primary mechanism for identifying the data in a measure is the Name property. The purpose of the Description property is to provide additional descriptive information.

Example

Use the following code to create a cube measure object and name it “MyMeasure”:

'Assume an object (dsoCube) of ClassType clsCube exists

Dim dsoMeasure As DSO.Measure

Set dsoMeasure = dsoCube.Measures.AddNew("MyMeasure")

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


OrdinalPosition

The OrdinalPosition property of the Measure interface contains the ordinal position of the measure in the parent object’s Measures collection.

Applies To
clsAggregationMeasure | clsPartitionMeasure
clsCubeMeasure |

The following table shows an example of measure ordinal positions.

Measure | Ordinal Position
Price | 1
Quantity | 2
Total_Amount | 3

Data Type

Integer

Access

Read-only

Remarks

The first measure is the default measure for the cube.

Example

Use the following code to return the ordinal position of a measure object:

Dim OrdPos As Integer

OrdPos = MeasureObject.OrdinalPosition

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


Parent

The Parent property of the Measure interface contains a reference to the parent MDStore object.

Applies To
clsAggregationMeasure | clsPartitionMeasure
clsCubeMeasure |

Data Type

MDStore

The class of the parent object depends on the class of the measure object.

Measure object class | Parent object class
clsCubeMeasure | clsCube
clsPartitionMeasure | clsPartition
clsAggregationMeasure | clsAggregation

Access

Read-only

Example

Use the following code to determine the class type of the parent object:

'Assume an object (dsoPartMea) of ClassType clsPartitionMeasure exists

Dim objParent As MDStore

Set objParent = dsoPartMea.Parent

Dim ClassType As ClassTypes

ClassType = objParent.ClassType

Select Case ClassType

    Case clsCube

        ' commands for a Cube object

    Case clsPartition

        ' commands for a Partition object

   Case clsAggregation

        ' commands for an Aggregation object

End Select

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


SourceColumn

The SourceColumn property of the Measure interface contains a reference to the column in the fact table that contains the measure.

Applies To
clsAggregationMeasure | clsPartitionMeasure
clsCubeMeasure |

Note For a virtual cube (a cube object with a SubClassType of sbclsVirtual) the SourceColumn property is used to reference a measure within an existing cube rather than a column in a source fact table. For more information, see clsCube.

Data Type

String

Access

The access type depends on the measure object’s class.

Class | Access
clsCubeMeasure | R/W
clsPartitionMeasure | R/W
clsAggregationMeasure | R

Remarks

The SourceColumn property works in conjunction with the SourceColumnType property.

Example

Use the following code to set a measure object SourceColumn to “Sales_Facts”.”Price”:

'Assume an object (dsoCubeMea) of ClassType clsCubeMeasure exists

dsoCubeMea.SourceColumn = """Sales_Facts"".""Price"""

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


SourceColumnType

The SourceColumnType property of the Measure interface contains a reference to the measure source column data type of the SourceColumn property.

Applies To
clsAggregationMeasure | clsPartitionMeasure
clsCubeMeasure |

Note The SourceColumnType property does not apply to an object of ClassType clsCube with a SubClassType of sbclsVirtual. For more information, see SubClassType.

ion
Data Type

ADODB.DataTypeEnum (an enumeration)

SourceColumnType is set to one of the following values.

ColumnTypeName | Value
Big Integer | adBigInt
Binary | adBinary
Boolean | adBoolean
String (Unicode) | adBSTR
Char | adChar
Currency | adCurrency
Date | adDate
Date | adDBDate
Time | adDBTime
Date & Time | adDBTimeStamp
Decimal | adDecimal
Double | adDouble
Integer | adInteger
Numeric | adNumeric
Single | adSingle
Small Integer | adSmallInt
Tiny Integer | adTinyInt
Unsigned Big Integer | adUnsignedBigInt
Unsigned Integer | adUnsignedInt
Unsigned Small Integer | adUnsignedSmallInt
Unsigned Tiny Integer | adUnsignedTinyInt
Char (Unicode) | adWChar
Text | adChar

Access

The access type depends on the class of the measure object.

Class | Access
clsCubeMeasure | R/W
clsCubeMeasure (virtual) | R
clsPartitionMeasure | R
clsAggregationMeasure | R

Remarks

The SourceColumnType property works in conjunction with the SourceColumn property. Be sure to specify a SourceColumn and SourceColumnType for each measure you create for a cube. For further information, see the Microsoft® ActiveX® Data Objects (ADO) Library.

Note You must reference the ADO Library in your project to use the ADODB.DataTypeEnum enumeration.

Example

Use the following code to specify and test a SourceColumnType.

'Assume an object (dsoCubeMea) of ClassType clsCubeMeasure exists

dsoCubeMea.ColumnType = adCurrency

...

Dim ColType As ADODB.DataTypeEnum

ColType = dsoCubeMea.ColumnType

Select Case ColType

   Case adDouble

        ' commands for adDouble

   Case adSingle

        ' commands for adSingle

            *

            *

            *

   Case Else

        ' other commands

End Select

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


SubClassType

The SubClassType property of the Measure interface contains an enumeration constant identifying the subclass type of the object.

Applies To
clsAggregationMeasure | clsPartitionMeasure
clsCubeMeasure |

Data Type

SubClassTypes (an enumeration)

Access

Read-only

Remarks

Objects that implement the Measure interface, that is, those of ClassType of clsAggregationMeasure, clsCubeMeasure, or clsPartitonMeasure, can have a SubClassType property of sbclsRegular only. For more information, see SubClassTypes in Enumerations.

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


Objects

There are two major object classifications in Microsoft® SQL Server™ OLAP Services Decision Support Objects (DSO):

  • Those that can be accessed and managed directly. These have their own collections, methods and properties, and include the following classes:
    • clsCubeAnalyzer
    • clsDatasource
    • clsMemberProperty
    • clsPartitionAnalyzer
    • clsServer

    Note A class type designation using the format clsClassType, such as clsServer, is used internally by DSO and does not necessarily correspond to a class definition in Microsoft Visual Basic®.

  • Those that implement a DSO interface. The following table lists the six DSO interfaces and the objects that implement them.
Interface | Implemented by
Command | clsDatabaseCommand clsCubeCommand
Dimension | clsDatabaseDimension clsCubeDimension clsPartitionDimension clsAggregationDimension
Level | clsDatabaseLevel clsCubeLevel clsPartitionLevel clsAggregationLevel
MDStore | clsDatabase clsCube clsPartition clsAggregation
Measure | clsCubeMeasure clsPartitionMeasure clsAggregationMeasure
Role | clsDatabaseRole clsCubeRole

For more information, see Interfaces.

Objects That Are Accessed Directly

When managing objects of ClassType clsCubeAnalyzer, clsDatasource, clsMemberProperty, clsPartitionAnalyzer or clsServer, which do not implement a shared interface, you access the object directly using normal Visual Basic syntax. For example, use the following code to create an object of ClassType clsServer and connect to an OLAP server:

'Code to instantiate a Server object

'Declaration section

Option Explicit

Public dsoServer As DSO.Server

...

Private Sub Form_Load()

    On Error GoTo FormLoad_Err

    Dim strServer As String

    strServer = InputBox("Server to attach to: ", "Attach to Server")

    Set dsoServer = New DSO.Server

    dsoServer.Connect (strServer)

    Exit Sub

FormLoad_Err:

    Debug.Print "Error connecting to server"

    Debug.Print Err.Number, Err.Description

    Err.Clear

    Debug.Assert False

End Sub

Objects That Are Accessed Through An Interface

The DSO object model uses interfaces to simplify your interaction with groups of related objects, while maintaining parent-child inheritance throughout the object model hierarchy. For more information about the complete hierarchy, see About Decision Support Objects.

Each DSO object that implements a DSO interface belongs to one of the following categories:

  • Aggregations
  • Commands
  • Cubes
  • Databases
  • Dimensions
  • Levels
  • Measures
  • Partitions
  • Roles

The uniqueness of multiple DSO objects within the same category is determined by where each is contained within the overall DSO object model hierarchy. For example, a cube can contain several dimensions. These dimension objects are contained in the cube’s Dimensions collection. Each of these dimension objects is a DSO object of ClassType clsCubeDimension.

Each cube also contains a collection of partition objects. Each of these partition objects also contains a collection of dimension objects in its Dimensions collection. Each of these dimension objects is a DSO object of ClassType clsPartitionDimension.

Although the DSO objects of ClassType clsCubeDimension and clsPartitionDimension are both dimension objects, their methods and properties are unique because of the parent objects in which their collections are contained. The DSO object model groups such objects together and manages them by the implementation of a common interface.


PivotTable Service

PivotTable® Service, which is included with Microsoft® SQL Server™ OLAP Services, is an OLE DB provider that supports the optional OLE DB for OLAP extensions introduced in OLE DB 2.0 and ADO 2.0. It is an in-process desktop OLAP server designed to provide online and offline data analysis and online access to OLAP data. PivotTable Service functions as a client of OLAP Services.

PivotTable Service functionality includes data analysis, cube building, and cache management functionality. It provides interfaces to data as well as functionality to manipulate data. PivotTable Service can store data locally on the client computer for offline analysis and offers connectivity to the multidimensional data managed by OLAP Services, other OLE DB-compliant providers, and to non-OLAP relational data sources.

PivotTable Service serves the following purposes:

  • Connects to OLAP Services as a client component. Thus, client applications connect to the same component both for OLAP Services and for stand-alone desktop analysis services.
  • Functions as a service provider for relational data sources to implement multidimensional functionality and expose the OLE DB interfaces with OLAP extensions.
  • Functions as a tabular data provider by supporting a subset of SQL.
  • Functions as a multidimensional data provider by supporting multidimensional expressions (MDX).
  • Enables client applications to create a local cube directly from a relational data source.
  • Functions as a mobile desktop OLAP client that enables users to download from data sources and store the data in a multidimensional structure on a local computer for offline analysis.

PivotTable Service can work with only a single local cube partition. PivotTable Service does not implement an internal aggregation management system for defining or storing aggregations, so its performance is directly related to the amount of data it manages.

PivotTable Service does not offer typical database administrator (DBA) support for activities such as defining users, data access rules, databases, virtual cubes, and global calculated members. However, PivotTable Service offers data definition language (DDL) and other statements that enable you to:

  • Define new local cubes and populate them with data.
  • Maintain calculated members, user-defined sets, and cache.

PivotTable Service supports MDX and a subset of SQL. For more information, see MDX, SQL in OLAP Services, and the Microsoft OLE DB documentation. PivotTable Service also extends the language defined in the OLE DB documentation by adding statements to create local cubes. For more information, see Data Definition Language.

Intended Audience

This topic and its subtopics are a guide for developers who want to write custom client applications for use with OLAP Services or create local cubes. They provide a description of PivotTable Service architecture and the interfaces that client applications can use. They assume a working knowledge of the following:

  • Multidimensional data warehousing and online analytical processing (OLAP) concepts
  • Microsoft OLE DB, including the OLE DB for OLAP extensions
  • MDX


Creating Local Cubes

You can define and save a local cube in either of two storage modes.

  • MOLAP (multidimensional OLAP)

    Use the CREATE CUBE statement to define a local cube and the INSERT INTO statement to populate it with dimension members and measures data. This saves the populated cube as a cube file in MOLAP storage mode. You can then connect to the local cube and analyze its data offline.

- Or -

  • ROLAP (relational OLAP)

    Use the CREATE CUBE statement to define a local cube and the INSERT INTO statement with the OPTIONS DEFER_DATA clause to populate it with dimension members. This saves the local cube structure definition and dimension members as a cube file in ROLAP storage mode, but does not save measures data in the local cube. You can then connect to the local cube and analyze its data without a connection to the OLAP server; however, you must be connected to the cube’s data source.

Local MOLAP cubes generally take longer to create and are much larger than local ROLAP cubes. However, local MOLAP cubes generally provide better performance during query execution.

Defining a Local Cube Structure

PivotTable® Service can be used to define cubes for local storage only, with a default file extension of .cub. You cannot use PivotTable Service to create cubes on an OLAP server. The source of data used to create a local cube must be a tabular data provider such as a relational database. (Microsoft® SQL Server™ OLAP Services can function as a tabular data provider.)

Use the CREATE CUBE statement to define the logical structure of a cube. Specify a local cube file name in the DBPROP_INIT_DATASOURCE property.

Caution If the specified cube file exists, it will be overwritten unless you set the DBPROP_MSMD_USEEXISTINGFILE property to T (true).

For more information, see Programmer’s Guide - PivotTable Service.

For more information about the CREATE CUBE statement, see CREATE CUBE.


Programmer's Guide - PivotTable Service

Programmer’s Guide - PivotTable Service

You can use PivotTable® Service in your custom applications to retrieve and manipulate multidimensional data from OLAP servers or local cube files, which may reference relational data sources. These custom applications typically perform the following functions:

  1. Connect to an OLAP server running Microsoft® SQL Server™ OLAP Services or a relational database through PivotTable Service.
  2. Create and save a local cube (optional).
  3. Retrieve a dataset using a multidimensional expressions (MDX) query.
  4. Display the resulting dataset in a custom viewer or browser.

The first, second, and fourth steps are described in the following topics. For information about retrieving a dataset using an MDX query, see Building an MDX Query.


DBPROP_INIT_DATASOURCE Property

Name of the server computer or local cube file.

Remarks

This property’s name, which is used in the connection string, is Data Source.

The property’s value depends on the intended operation mode:

  • To work with an OLAP server, specify the name of the server computer, or LOCALHOST, or LOCAL, or an IP address.
  • To build or work with a local cube file, specify the name of the cube file. Local cube files have the default extension of .cub, but can have any extension.
  • To build a temporary local cube file that will be deleted when the session ends, specify a null value.

This property’s value is used when a session is established, but the value cannot be changed during the session.


DBPROP_MSMD_CREATE_CUBE Property

CREATE CUBE statement to create a local cube file.

Remarks

This property’s name, which is used in the connection string, is CREATECUBE.

You must use this property if you also use the DBPROP_MSMD_INSERT_INTO property and the DBPROP_MSMD_SOURCE_DSN property. When these three properties are used, they are always used together.

This property’s value is used when a session is established, but the value cannot be changed during the session.


DBPROP_MSMD_INSERT_INTO Property

INSERT INTO statement to populate a local cube file created with CREATE CUBE.

Remarks

This property’s name, which is used in the connection string, is INSERTINTO.

You must use this property if you also use the DBPROP_MSMD_CREATE_CUBE property and the DBPROP_MSMD_SOURCE_DSN property. When these three properties are used, they are always used together.

This property’s value is used when a session is established, but the value cannot be changed during the session.


DBPROP_MSMD_SOURCE_DSN Property

OLE DB connection string, ODBC connection string, or ODBC data source name (DSN) for the source relational database.

Remarks

This property’s name, which is used in the connection string, is SOURCE_DSN.

This property is used only when creating a local cube file.

You must use this property if you also use the DBPROP_MSMD_CREATE_CUBE property and the DBPROP_MSMD_INSERT_INTO property. When these three properties are used, they are always used together.

This property’s value is used when a session is established, but the value cannot be changed during the session.


DBPROP_MSMD_USEEXISTINGFILE Property

Determines whether a local cube file is overwritten if the connection string contains CREATE CUBE and INSERT INTO statements.

Remarks

This property’s name, which is used in the connection string, is UseExistingFile.

If the first character of this property’s value is Y, T, or a numeric digit other than 0 (zero), and the cube file specified in the DBPROP_INIT_DATASOURCE property already exists, the DBPROP_MSMD_CREATE_CUBE and DBPROP_MSMD_INSERT_INTO properties are ignored, and a connection to the existing local cube is established. If the DBPROP_MSMD_USEEXISTINGFILE property is not used, or the first character of this property’s value is not Y, T, or a numeric digit other than 0 (zero), and the cube file specified in the DBPROP_INIT_DATASOURCE property already exists, the statements in the DBPROP_MSMD_CREATE_CUBE and DBPROP_MSMD_INSERT_INTO properties overwrite the existing cube file.

This property’s value is used when a session is established, but the value cannot be changed during the session.

See Also

DBPROP_MSMD_CREATE_CUBE

DBPROP_MSMD_INSERT_INTO


Data Definition Language

The following topics supplement the multidimensional expressions (MDX) syntax documented in the OLE DB for OLAP extensions to OLE DB, which are not repeated here. It contains Backus-Naur Form (BNF) definitions and information about the additional data definition language (DDL) statements implemented by PivotTable® Service. These statements support the MDX syntax.

Statement | Description
CREATE CACHE | Defines cache on the session level.
CREATE CUBE | Defines the logical structure of a local cube.
CREATE MEMBER | Defines a calculated member on the session level.
CREATE SET | Defines a user-defined set on the session level.
DROP MEMBER | Deletes a calculated member.
DROP SET | Deletes a user-defined set.
REFRESH CUBE | Rereads the data that formed the local cube.

See Also

INSERT INTO


CREATE CACHE

The CREATE CACHE statement allows you to populate the cache with a slice of cube data defined by sets of members.

You can define cache for use by a single query with the WITH clause in the SELECT statement, or for use by multiple queries in a session with the CREATE CACHE statement. For more information about WITH, see Using WITH to Define Calculated Members, Sets, and Cache.

BNF

<create-cache-statement> ::= CREATE <optional-scope> <create-cache-subset> [<create-cache-subset>...]

<create-cache-subset> ::= CACHE FOR <cube-name> AS '(<set-expression> [,<set-expression>...])'

<optional-scope> ::= <empty> | SESSION

Remarks

Each <set-expression> must contain members from only one dimension. Each member must be distinct.

Each <set-expression> must be from a different dimension.

The <set-expression> can contain functions that support MDX syntax.

The <set-expression> cannot contain measures.

Cache created with CREATE CACHE without an <optional-scope> value has session scope.

Example

CREATE SESSION CACHE FOR Warehouse AS '({USA,Canada})'

Scope

Cache can occur within one of two scopes:

  • Query scope. The lifetime of the cache is limited to the query. The cache is defined in an individual query. Query scope overrides session scope. For more information, see Using WITH to Define Calculated Members, Sets, and Cache.
  • Session scope. The lifetime of the cache is limited to the session in which it is created. The CREATE CACHE statement is used to create cache with session scope.


CREATE CUBE

The CREATE CUBE statement defines the structure of a new local cube. This statement shares much of the syntax and semantics of SQL-92 syntax and shares the semantics of the CREATE TABLE statement. However, the CREATE CUBE statement contains syntax specific to cubes.

The cube is not populated when the CREATE CUBE statement is executed. The cube is populated using the INSERT INTO statement in a manner similar to the SQL-92 approach for creating and populating tables.

For more information about cubes, see Administrator’s Guide.

BNF

<create-cube-statement > ::= CREATE CUBE <cube name> <open paren>

DIMENSION <dimension name> [TYPE TIME],

<hierarchy def> [<hierarchy def>...]

[{, DIMENSION <dimension name> [TYPE TIME],

<hierarchy def> [<hierarchy def>...]}...] ,

MEASURE <measure name> <measure function def> [<measure format def>] [<measure type def>]

[{, MEASURE <measure name> <measure function def> [<measure format def>] [<measure type def>] }...]

[,COMMAND <expression>]

[,COMMAND <expression>...]

<close paren>

<dimension name> ::= <legal name>

<hierarchy def> ::= [HIERARCHY <hierarchy name>,] <level def> [,<level def>...]

<level def> ::= LEVEL <level name> [TYPE <level type>] [<level format def>] [<level options def>]

<level type> ::= ALL | YEAR | QUARTER | MONTH | WEEK | DAY | DAYOFWEEK | DATE | HOUR | MINUTE | SECOND

<level format def> ::= FORMAT_NAME <expression> [FORMAT_KEY <expression>]

<level options def> ::= OPTIONS (<option_list>)

<option_list> :: = <option> [,<option_list>]

<option> ::= UNIQUE | SORTBYNAME | SORTBYKEY

<measure function def> ::= FUNCTION <function name>

<measure format def> ::= FORMAT <expression>

<function name> ::= SUM | MIN | MAX | COUNT

<measure type def> ::= TYPE <supported OLEDB numeric types>

<supported OLEDB numeric types> :: = DBTYPE_I1 | DBTYPE_I2 | DBTYPE_I4 | DBTYPE_I8 | DBTYPE_UI1 | DBTYPE_UI2 | DBTYPE_UI4 | DBTYPE_UI8 | DBTYPE_R4 | DBTYPE_R8 | DBTYPE_CY | DBTYPE_DECIMAL | DBTYPE_NUMERIC | DBTYPE_DATE

Remarks
  • In the DIMENSION clause of the CREATE CUBE statement, the name given to a level of TYPE ALL applies the specified name to the ALL member rather than the ALL level; the ALL level always has the name (All). For example, the clause LEVEL [All Customers] TYPE ALL creates a level named (All) containing a single member named [All Customers]. There is no [All Customers] level.
  • If the <expression> value of the COMMAND clause has spaces, the whole expression should be surrounded by brackets. It is not recommended to use quotation marks for this purpose because the body of the command might include quotation marks. (OLAP Services supports nested brackets but not nested quotation marks.)

Example

CREATE CUBE Sales

(

DIMENSION Time TYPE TIME,

   HIERARCHY [Fiscal],

      LEVEL [Fiscal Year] TYPE YEAR,

      LEVEL [Fiscal Qtr] TYPE QUARTER,

      LEVEL [Fiscal Month] TYPE MONTH OPTIONS (SORTBYKEY, UNIQUE),

   HIERARCHY [Calendar],

      LEVEL [Calendar Year] TYPE YEAR,

      LEVEL [Calendar Month] TYPE MONTH,

DIMENSION Products,

      LEVEL [All Products] TYPE ALL,

      LEVEL Category,

      LEVEL [Sub Category],

      LEVEL [Product Name],

DIMENSION Geography,

      LEVEL [Whole World] TYPE ALL,

      LEVEL Region,

      LEVEL Country,

      LEVEL City,

MEASURE [Sales]

   FUNCTION SUM

   FORMAT 'Currency',

MEASURE [Units Sold]

   FUNCTION SUM

   TYPE DBTYPE_UI4

)


CREATE MEMBER

The CREATE MEMBER statement allows the creation of calculated members.

You can define a calculated member for use by a single query with the WITH clause in the SELECT statement, or for use in multiple queries in a session with the CREATE MEMBER statement. For more information about WITH, see Using WITH to Define Calculated Members, Sets, and Cache.

A newly created calculated member can have several properties such as SolveOrder. The syntax allows setting these properties.

BNF

<create-member-statement> ::= CREATE <optional-scope> <create-member-subset> [<create-member-subset>...]

<create-member-subset> ::= MEMBER <cube-name>.<fully-qualified-member-name> AS '<expression>' [,<property-definition-list>]

<property-definition-list> ::= <property-definition>
| <property-definition>, <property-definition-list>

<property-definition> ::= <property-identifier> = <property-value>

<property-identifier> ::= <identifier>

<property-value> ::= <string> | <number>

<optional-scope> ::= <empty> | SESSION

Remarks

The <expression> value can contain functions that support multidimensional expressions (MDX) syntax.

The valid <property-identifier> values are listed under “Standard Properties” later in this topic.

Calculated members created with CREATE MEMBER without an <optional-scope> value have session scope.

Example 1

CREATE MEMBER [WAREHOUSE].[MEASURES].[WAREHOUSEPROFIT]

       AS '[MEASURES].[WAREHOUSE SALES] - [MEASURES].[WAREHOUSE COST]'

Example 2

CREATE MEMBER [WAREHOUSE].[MEASURES].[WAREHOUSEPROFIT]

       AS '[MEASURES].[WAREHOUSE SALES] - [MEASURES].[WAREHOUSE COST]',

       SOLVEORDER=3

Scope

A calculated member can occur within one of three scopes:

  • Query scope. The visibility and lifetime of the calculated member is limited to the query. The calculated member is defined in an individual query. Query scope overrides session and global scope. For more information, see Using WITH to Define Calculated Members, Sets, and Cache.
  • Session scope. The visibility and lifetime of the calculated member is limited to the session in which it is created. (The lifetime is less than the session duration if a DROP MEMBER statement is issued on the calculated member.) The CREATE MEMBER statement is used to create a calculated member with session scope. Session scope overrides global scope.
  • Global scope. The visibility and lifetime of the calculated member is not limited to queries or sessions because the calculated member definition is stored (but its data is not). For more information about creating calculated members with global scope, see Creating Calculated Members.

A calculated member can be persisted in a local cube if a CREATE MEMBER statement is specified in the COMMAND clause of the CREATE CUBE statement.

CREATE CUBE MYWAREHOUSE

(

DIMENSION . . .

. . . ,

COMMAND [CREATE MEMBER [MYWAREHOUSE].[MEASURES].[WAREHOUSEPROFIT]

        AS '[MEASURES].[WAREHOUSE SALES] - [MEASURES].[WAREHOUSE COST]']

)

Quoted Strings in Calculated Member Definitions

Strings inside calculated member definitions are delimited with double quotation marks.

Standard Properties

Each calculated member has a set of default properties. When a client is connected to Microsoft® SQL Server™ OLAP Services, the default properties are either supported or available to be supported, as the administrator chooses.

Additional member properties may be available, depending upon the cube definition. These properties represent information relevant to the dimension level in the cube.

Property Identifier | Meaning
SolveOrder | The order in which the calculated member will be solved in case of intersection with other calculated members.
Format_String | Microsoft Office format string for displaying cell values.


CREATE SET

The CREATE SET statement allows the creation of user-defined sets.

You can define a set for use by a single query with the WITH clause in the SELECT statement, or for use in multiple queries in a session with the CREATE SET statement. For more information about WITH, see Using WITH to Define Calculated Members, Sets, and Cache.

BNF

<create-set-statement> ::= CREATE <optional-scope> <create-set-subset> [<create-set-subset>...]

<create-set-subset> ::= SET <cube-name>.<set-name> AS '<set-expression>'

<optional-scope> ::= <empty> | SESSION

Remarks

The <set-expression> value can contain functions that support multidimensional expressions (MDX) syntax.

Sets created with CREATE SET without an <optional-scope> value have session scope.

Scope

A user-defined set can occur within one of three scopes:

  • Query scope. The visibility and lifetime of the set is limited to the query. The set is defined in an individual query. Query scope overrides session and global scope. For more information, see Using WITH to Define Calculated Members, Sets, and Cache.
  • Session scope. The visibility and lifetime of the set is limited to the session in which it is created. (The lifetime is less than the session duration if a DROP SET statement is issued on the set.) The CREATE SET statement is used to create a set with session scope. Session scope overrides global scope.
  • Global scope. The visibility and lifetime of the set is not limited to queries or sessions because the set definition is stored (but its data is not). For more information about creating sets with global scope, see Creating Calculated Members.


DROP MEMBER

The DROP MEMBER statement allows the deletion of calculated members.

BNF

<drop-member-statement> ::= DROP MEMBER <cube-name>.<fully-qualified-member-name>


DROP SET

The DROP SET statement allows the deletion of user-defined sets.

BNF

<drop-set-statement> ::= DROP SET <cube-name>.<set-name>


REFRESH CUBE

For clients connected to an OLAP server running Microsoft® SQL Server™ OLAP Services, the REFRESH CUBE statement causes the memory cached on the client to be synchronized with the server.

For clients connected to a local cube, the REFRESH CUBE statement causes the local cube file to be rebuilt.

BNF

<refresh-cube-statement> ::= REFRESH CUBE <cube-name>


INSERT INTO

The INSERT INTO statement populates a local cube with dimension members. If the local cube is in MOLAP storage mode, the INSERT INTO statement also populates the local cube with data. The INSERT INTO statement is used after a CREATE CUBE statement to create a local cube.

BNF

<insert-into-statement> ::= INSERT INTO <target-clause>
[<options-clause>] [<bind-clause>] <source-clause>

<target-clause> ::= <cube-name> <open-paren> <target-element-list>
<close-paren>

<target-element-list> ::= <target-element>[, <target-element-list>]

<target-element> ::= [<dim-name>.[<hierarchy-name>.]]<level-name>
| <time-dim-name>
| [Measures.]<measure-name>
| SKIPONECOLUMN

<level-name> ::= <simple-level-name> | <simple-level-time>.NAME | <simple-level-time>.KEY

<time-dim-name> ::= <dim-name-type-time> | <dim-name-type-time>.NAME | <dim-name-type-time>.KEY

<options-clause> ::= OPTIONS <options-list>

<options-list> ::= <option>[, <options-list>]

<option> ::= <defer-options> | < analysis-options>

<defer-options> ::= DEFER_DATA | ATTEMPT_DEFER

<analysis-options> ::= PASSTHROUGH | ATTEMPT_ANALYSIS

<bind-clause> ::= BIND (<bind-list>)

<bind-list> ::= <simple-column-name>[,<simple-column-name>]

<simple-column-name> ::= <identifier>

<source-clause> ::= SELECT <columns-list>
FROM <tables-list>
[ WHERE <where-clause> ]
| DIRECTLYFROMCACHEDROWSET <hex-number>

<columns-list> ::= <column-expression> [, < columns-list> ]

<column-expression> ::= <column-expression-name>

<column-expression-name> ::= <column-name> [AS <alias-name>]
| <alias name> <column-name>

<column-name> ::= <table-name>.<column-name>
| <column-function> | <ODBC scalar function> | <braced-expression>

<column function> ::= <identifier>(. . .)

<ODBC scalar function> ::= {FN<column-function>}

<braced-expression> ::= (. . .)

<tables list> ::= <table-expression> [, <table-list>]

<table-expression> ::= <table-name> [ [AS] <table-alias>]

<table-alias> ::= <identifier>

<table-name> ::= <identifier>

<where clause> ::= <where-condition> [AND <where-clause>]

<where condition> ::= <join-constraint> | <application constraint>

<join-constraint> ::= <column-name> = <column-name>
| <open-paren><column-name> = <column-name><close-paren>

<application-constraint> ::= (. . .)
| NOT (. . .)

| (. . .) OR (. . .)

<identifier> ::= <letter>{<letter>|<digit>|<underline>|<dollar>|<sharp>}. . .

Remarks
  • Names of elements in an INSERT INTO statement are level and measure names, sometimes qualified with dimension name or the keyword Measures to avoid ambiguity. The Measures keyword is case-sensitive in binary comparisons. If you use binary comparison or are unsure of your comparison method, use Measures as shown with only “M” in upper case.
  • Each level and each measure in a cube is derived from a column in the SELECT clause.
  • The columns specified in the associated SELECT clause are bound to the elements of the INSERT INTO statement in the order specified and in a one-to-one relationship.
  • Each level can be derived from two columns, with one used as a name column and the other used as a key column. Both columns must be in the same table. If there are two columns associated with a level, suffix .NAME or .KEY should be used in the INSERT INTO statement after the level name.
  • If a column specified in the SELECT clause does not have a related element in the INSERT INTO statement, the keyword SKIPONECOLUMN can be used in the INSERT INTO statement as a placeholder for the unused column. SKIPONECOLUMN can be used more than once.
  • In the INSERT INTO statement, a dimension of TYPE TIME can be specified by the name of the dimension. The dimension name is used to correlate the entire dimension with a single column in the source table that contains data with a date/time data type. The levels, of TYPE <level type>, identified for the time dimension in the CREATE CUBE statement cause the time information to be extracted from the source column specified in the SELECT clause. See Example 4 later in this topic.
  • The WHERE clause can have both application and join constraints. The parser will parse only join constraints. It uses the join constraint to find a path from all tables to the fact table and to the dimension tables. The application constraint is used only to specify constraints on a fact table and is passed through without modifications.
  • Expressions between parentheses are considered to be application constraints. For example, if the expression Sales.Product_ID = Products.Product_ID AND Sales.Customer_ID = Customers.Customer_ID is enclosed in parentheses, it is treated as an application constraint and is not used as a join constraint. It is the responsibility of the client application to ensure that parentheses are used only around application constraints. For example, (Product.Price < 100 AND Product.Category = 1).
  • The BIND clause is used to bind level and measure names specified in the INSERT INTO statement with column names used to create rowsets.
  • The AS <alias-name> syntax is not supported for local ROLAP cubes.

Example 1

INSERT INTO MyCube (Year, Month.Name, Month.Key, [Product Group], [Product Name], Country, Sales, Cost)

OPTIONS DEFER_DATA

SELECT MyTable.Year, MyTable.Month, MONTH(MyTable.Month), MyTable.ProdGroup, MyTable.ProdName, MyTable.Country, MyTable.Sales, MyTable.Cost

FROM MyTable

WHERE MyTable.SalesRep = "Amir" and MyTable.CustomerGroup = "Industry"

Example 2

INSERT INTO MyCube (Year, Month, [Product Group], [Product Name], Country, Sales, Cost)

OPTIONS PASSTHROUGH SELECT MyTable.Year, MyTable.Month, MyTable.ProdGroup, MyTable.ProdName, MyTable.Country, MyTable.Sales, MyTable.Cost

FROM MyTable

WHERE MyTable.SalesRep = "Amir" and MyTable.CustomerGroup = "Industry"

Note The PASSTHROUGH option specifies that the SELECT clause that follows it is to be passed directly to the database engine with no parsing by PivotTable® Service.

Example 3

INSERT INTO MyCube (Year, Month, [Product Group], [Product Name], Country, Sales, Cost)

DIRECTLYFROMCACHEDROWSET 0x00001284

Note The DIRECTLYFROMCACHEDROWSET keyword directs data to be read from the address in memory identified immediately after the keyword. It is the responsibility of the client application to specify the correct address in memory. At run time, the number is assumed to be the in-process address of an IUnknown pointer to an OLE DB rowset.

Example 4

CREATE CUBE MyCube (

DIMENSION TimeDim TYPE TIME,

   LEVEL MyYear TYPE YEAR,

   LEVEL MyQtr TYPE QUARTER,

   LEVEL MyMonth TYPE MONTH,

DIMENSION Products,

   LEVEL [Product Group],

   LEVEL [Product Name],

DIMENSION Geography,

   LEVEL State,

   LEVEL City,

MEASURE [Sales]

   FUNCTION SUM

   FORMAT ‘Currency’,

MEASURE [Units Sold]

   FUNCTION SUM

)

INSERT INTO MyCube (TimeDim, [Product Group], [Product Name], State, City, Sales, [Units Sold])

OPTIONS DEFER_DATA

SELECT MyTable.TransDate, MyTable.ProdGroup, MyTable.ProdName, MyTable.State, MyTable.City, MyTable.Sales, MyTable.UnitsSold

FROM MyTable

WHERE MyTable.SalesRep = "Jacobsen" and MyTable.CustomerGroup = "Industry"

Passthrough and Advanced Query Processing

The PASSTHROUGH option causes the SELECT clause to be passed directly to the source database without modification by PivotTable Service. If PASSTHROUGH is not specified, PivotTable Service parses the query and formulates a set of queries equivalent to the original that is optimized for the source database and index structures. This set of queries is often more efficient than the specified query.

The DEFER_DATA option causes the query to be parsed locally and executed only when necessary to retrieve data to satisfy a user request. DEFER_DATA is used to specify that a local cube is defined in the ROLAP storage mode.

The ATTEMPT_DEFER option causes PivotTable Service to attempt to parse the query and defer data loading if successful, or, if the query cannot be parsed, to process the specified query immediately as if the PASSTHROUGH had been specified.

The ATTEMPT_ANALYSIS option causes PivotTable Service to attempt to parse the query and formulate an optimized set of queries (process in the MOLAP mode), or, if the query can’t be parsed, to process the specified query immediately as if the PASSTHROUGH had been specified.

Passthrough Compatibility Matrix

In the following matrix, “PT” indicates passthrough.

 | Parse | Neither PassThrough Nor Attempt_Analysis | PassThrough | Attempt_Analysis
Neither DEFER_DATA nor ATTEMPT_DEFER | Succeeded | MOLAP | MOLAP(PT) | MOLAP
 | Failed | Error | n/a | MOLAP(PT)
DEFER_DATA | Succeeded | ROLAP | Error | ROLAP
 | Failed | Error | n/a | Error
ATTEMPT_DEFER | Succeeded | ROLAP | MOLAP(PT) | ROLAP
 | Failed | MOLAP(PT) | n/a | MOLAP(PT)


MDX

Microsoft® SQL Server™ OLAP Services implements multidimensional expressions (MDX) for manipulating multidimensional data. MDX is defined in the OLAP extensions in OLE DB.

MDX provides a rich and powerful syntax for querying and manipulating the multidimensional data stored in OLAP server cubes. OLAP Services supports MDX functions in the definitions of calculated members, and in a full language implementation for building local cubes and querying cube data using PivotTable® Service with OLE DB and Microsoft ActiveX® Data Objects (ADO).

You can also create and register your own functions that operate on multidimensional data as well as accept arguments and return values in the MDX syntax.

Defining Calculated Members

OLAP Services provides over 100 built-in MDX functions for defining sophisticated calculated members in the Cube editor’s Calculated Member Builder. These functions are divided into the following categories:

  • Array functions
  • Dimension functions
  • Hierarchy functions
  • Level functions
  • Logical functions
  • Member functions
  • Numeric functions
  • Set functions
  • String functions
  • Tuple functions

For more information, see Creating Calculated Members and Calculated Member Builder.

Building Local Cubes

You can create a local cube to be stored on a computer other than the computer running the OLAP server. Creation of a local cube requires MDX syntax.

Creation of local cubes is accomplished through PivotTable Service, which is an OLE DB client to an OLAP server. PivotTable Service also provides stand-alone OLE DB provider capabilities for local cube creation when not connected to an OLAP server.

Use the CREATE CUBE and INSERT INTO statements to create a local cube. For more information, see Creating Local Cubes and CREATE CUBE.

Querying Cubes

In OLAP Services, all querying of cube data is performed through PivotTable Service. PivotTable Service also provides stand-alone OLE DB provider capabilities for querying when not connected to an OLAP server.

PivotTable Service implements MDX for manipulating multidimensional data and objects.

For more information about PivotTable Service, see PivotTable Service. For more information about querying with MDX, see Building an MDX Query.

See Also

OLE DB 2.0 and later documentation

ADO 2.0 and later documentation

User-defined Functions

You can create and register your own functions that operate on multidimensional data as well as accept arguments and return values in the MDX syntax. You can create functions using Component Object Model (COM) automation languages such as Microsoft Visual Basic® or Microsoft Visual C++®.

You can call user-defined functions from within the Calculated Member Builder, data definition language (DDL) statements that support MDX, and MDX queries.

For more information, see User-defined Functions with MDX Syntax.


Building an MDX Query

Traditional SQL statements alone can be used to query cubes, but they return two-dimensional rowsets. To return a multidimensional dataset, multidimensional expressions (MDX) must be used. The MDX dialect, described in detail in the OLE DB documentation, enables you to query cubes, which contain multidimensional data, and return multidimensional datasets. This topic and its subtopics provide an overview of MDX queries.

As with traditional SQL, the creator of a MDX query must determine the structure of the returned dataset before writing the query. The subtopics that follow describe MDX queries in relation to the datasets expected to be returned from the queries.

Most frequently, creators of MDX queries visualize the returned datasets as multidimensional structures. The creator of a traditional SQL query visualizes and defines the structure of a two-dimensional rowset and writes a query on tables to populate it. In contrast, the creator of an MDX query usually visualizes and defines the structure of a multidimensional dataset and writes a query on a cube to populate it. (MDX queries can also return two-dimensional datasets, however.)

Visualizing multidimensional datasets can be difficult. One method is to limit the presentation to a flattened, two-axis medium, nesting multiple dimensions on a single axis. (This method is used by tabular cube browsers such as the Cube browser included with Microsoft® SQL Server™ OLAP Services.) Nesting produces subheadings. The members of a nested dimension are displayed as subheadings beneath (or beside) the members of the nesting dimension. This visualization method is used in the following topics.


Cube and Dataset Example

In this example, which is repeatedly referenced in the following topics, SalesCube has the following six dimensions:

  • SalesPerson
  • Geography, a hierarchy that has the levels Countries, Regions, and Cities
  • Quarters, a hierarchy that has the levels Quarters, Months, and Days
  • Years
  • Measures: Sales, PercentChange, and BudgetedSales
  • Products

Consider the following dataset to be returned from this cube by an MDX query:

The characteristics of this dataset are:

  • Axis dimensions: Quarters, SalesPerson, Geography.
  • Slicer dimensions: Measures, Years, Products.
  • Two axes:
    • x-axis, also known as COLUMNS or axis 0.
    • y-axis, also known as ROWS or axis 1.
  • x-axis: Salesperson and Geography dimensions (the latter is nested in the former).
  • y-axis: Quarters dimension.


Using WITH to Define Calculated Members, Sets, and Cache

Within an MDX query, you can use the WITH clause to specify a calculated member (or measure), a user-defined set, or cache that can be used only in the current query (that is, only within query scope). To define these items for use in session scope, use the data definition language (DDL) statements described in the subtopics of PivotTable Service. To define calculated members and user-defined sets for use in global scope, use the Calculated Member Builder.

An MDX query with the optional WITH clause has the following basic syntax:

WITH <single_formula_specification> [<single_formula_specification>...]

SELECT <axis_specification> [, <axis_specification>...]

FROM <cube_specification>

WHERE <slicer_specification>

The breakdown of the <single_formula_specification> syntax is:

<single_formula_specification> ::= <member_specification> | <set_specification> | <cache_specification>

The <member_specification> syntax is used to define a calculated member or measure, and it breaks down as follows:

<member_specification> ::= MEMBER <parent_of_member>.<member_name> AS '<value_expression>'

The <value_expression> value can include functions that support MDX syntax.

The <set_specification> syntax is used to define a set, and it breaks down as follows:

<set_specification> ::= SET <set_name> AS '<set>'

Following the WITH clause, the <member_name> or <set_name> value is used to reference the calculated member or set.

The <cache_specification> syntax is used to populate cache with a cube slice defined by sets of members, and it breaks down as follows:

<cache_specification> ::= CACHE AS '(<set> [,<set>])'

The <set> value, in both the <set_specification> syntax and the <cache_specification> syntax, can include functions that support MDX syntax.

When using <set> within the <cache_specification> syntax, the following rules apply:

  • Each <set> must contain members from only one dimension. Each member must be distinct.
  • Each <set> must be from a different dimension.
  • The <set> cannot contain measures.

Examples

The following two MDX queries use the WITH clause to modify the dataset described in Cube and Dataset Example. A calculated member is defined to create new columns that sum the USA and Japan Sales. A set is defined to produce the y-axis but does not modify the dataset.

The revised dataset to be produced by each of the two queries is:

Example 1

The following MDX query produces the preceding dataset by defining a calculated member named USA_and_Japan that adds USA and Japan Sales. The calculated member is used in the x-axis (COLUMNS).

WITH MEMBER All_Countries.USA_and_Japan AS 'SUM({USA, Japan})'

SELECT CROSSJOIN({Smith, Jones},

   {USA_North.CHILDREN, USA_South, Japan, USA_and_Japan}) ON COLUMNS,

   {Qtr1.CHILDREN, Qtr2, Qtr3, Qtr4.CHILDREN} ON ROWS

FROM SalesCube

WHERE (Sales, [1997], Products.All)

Example 2

The following MDX query adds a set definition to the previous example but produces the same dataset. The set is named Expand_Qtrs_1_4 and contains the previously used members of the Quarters dimension. The set is used in the y-axis (ROWS).

WITH MEMBER All_Countries.USA_and_Japan AS 'SUM({USA, Japan})'

     SET Expand_Qtrs_1_4 AS '{Qtr1.CHILDREN, Qtr2, Qtr3, Qtr4.CHILDREN}'

SELECT CROSSJOIN({Smith, Jones},

   {USA_North.CHILDREN, USA_South, Japan, USA_and_Japan}) ON COLUMNS,

   Expand_Qtrs_1_4 ON ROWS

FROM SalesCube

WHERE (Sales, [1997], Products.All)


User-defined Functions with MDX Syntax

You can create and register your own functions that operate on multidimensional data. These functions, called “user-defined functions” (UDFs), can accept arguments and return values in the MDX syntax. You can create UDFs using Component Object Model (COM) automation languages such as Microsoft® Visual Basic® or Microsoft Visual C++®. A UDF can be developed on any tool capable of generating Microsoft ActiveX® libraries.

Before you use a UDF, you must register the library (that is, file) in which it is compiled. You can register UDF libraries of the following types:

  • Type libraries (*.olb, *.tlb, *.dll)
  • Executable files (*.exe, *.dll)
  • ActiveX controls (*.ocx)

To register a UDF library, issue a USE LIBRARY statement. Its syntax is:

USE LIBRARY "<library_path_and_file_name>" | <program_ID> [,"<library_path_and_file_name>" | <program_ID>...]

Example:

USE LIBRARY "c:\functions\mylib.dll"

To register multiple libraries, issue a USE LIBRARY statement with multiple parameters in a comma-separated list. Example:

USE LIBRARY "c:\functions\mylib.dll","c:\functions\johnslib.dll"

A USE LIBRARY statement with no parameters unregisters all function libraries except the Microsoft SQL Server™ OLAP Services function library.

Hidden and restricted UDFs are not supported.

Note UDFs are supported only if they accept as arguments only string or numeric data types, or array or variant data types containing string or numeric values. In addition, UDFs are supported only if they return only string or numeric data types, or variant data types containing numeric values.

Multiple UDFs can reside in the same ActiveX library.

Calling a User-defined Function within MDX

After a user-defined function (UDF) is registered, it can be used anywhere in the MDX syntax that allows expressions. For example:

With Member Measures.[Forecasted Sales] As

     'Sale * ForecastedGrowthRate(SaleReps.CurrentMember.Name)'

Select TopCount(SalesReps, HowManyReps(), Sales) on Rows,

     {Sales, [Forecasted Sales] } on Columns

From Sales

The HowManyReps and ForecastedGrowthRate UDFs are defined as:

Public Function HowManyReps() as Integer

Public Function ForecastedGrowthRate(RepName as String) as Double

UDFs can also be used in the Calculated Member Builder.

Note When you call a UDF, you can omit an optional argument only if you also omit all arguments that follow it.

Function Precedence and Qualification

If multiple function libraries contain a function with the same name, the OLAP Services function library takes precedence. Excluding the OLAP Services function library, precedence is resolved in order of registration by the USE LIBRARY statement.

You can override precedence or call functions from specific libraries by using the following syntax when you invoke the function:

programid!functionname(argument1,argument2,…)

Note that the function name is preceded by the function library’s program ID and an exclamation point (!). This syntax ensures that the correct function is called in cases where a function name is not unique among libraries.

If a library includes multiple interfaces, you can use the following syntax to specify the library and interface:

programid!interfaceid!functionname(argument1,argument2,…)


Visual Basic for Applications Functions

Microsoft® SQL Server™ OLAP Services supports many functions in the Microsoft Visual Basic® for Applications Expression Services library. This library is included with OLAP Services and automatically registered. Functions not supported in this release are marked by an asterisk in the table below.

Abs | *Add | *AppActivate | *Array
Asc | AscB | AscW | Atn
*Beep | *Calendar | *CallByName | CBool
CByte | CCur | CDate | CDbl
*CDec | *ChDir | *ChDrive | *Choose
Chr | *ChrB | ChrW | CInt
*Clear | CLng | *Command | Cos
*Count | *CreateObject | CSng | CStr
CurDir | CVar | CVDate | *CVErr
Date | DateAdd | DateDiff | DatePart
DateSerial | DateValue | Day | DDB
*DeleteSetting | *Description | *Dir | *DoEvents
Environ | *EOF | *Err | *Error
Exp | *FileAttr | *FileCopy | FileDateTime
FileLen | *Filter | Fix | Format
*FormatCurrency | *FormatDateTime | *FormatNumber | *FormatPercent
*FreeFile | FV | *GetAllSettings | *GetAttr
*GetObject | *GetSetting | *HelpContext | *HelpFile
Hex | Hour | IIf | *IMEStatus
*Input | *InputB | *InputBox | InStr
InStrB | *InStrRev | Int | IPmt
*IRR | *IsArray | IsDate | *IsEmpty
IsError | *IsMissing | IsNull | IsNumeric
*IsObject | *Item | *Join | *Kill
*LastDllError | LCase | Left | LeftB
Len | LenB | *Loc | *LOF
Log | LTrim | Mid | MidB
Minute | *MIRR | *MkDir | Month
*MonthName | *MsgBox | Now | NPer
*NPV | *Number | Oct | *Partition
Pmt | PPmt | PV | QBColor
*Raise | *Randomize | Rate | *Remove
*Replace | *Reset | RGB | Right
RightB | *RmDir | Rnd | Round
RTrim | *SaveSetting | Second | *Seek
*SendKeys | *SetAttr | Sgn | Shell
Sin | SLN | *Source | Space
*Split | Sqr | Str | StrComp
String | *StrReverse | *Switch | SYD
Tan | Time | Timer | TimeSerial
TimeValue | Trim | TypeName | UCase
Val | *VarType | Weekday | *WeekdayName
*Width | Year |  |


Excel Functions

Microsoft® SQL Server™ OLAP Services supports many functions in the Microsoft Excel worksheet library, which is automatically registered if installed on the computer with OLAP Services. Functions not supported in this release are marked by an asterisk in the table below.

Acos | Acosh | And | *Application
Asc | Asin | Asinh | Atan2
Atanh | AveDev | Average | BetaDist
BetaInv | BinomDist | Ceiling | ChiDist
ChiInv | ChiTest | Choose | Clean
Combin | Confidence | Correl | Cosh
Count | CountA | *CountBlank | *CountIf
Covar | *Creator | CritBinom | *DAverage
Days360 | Db | Dbcs | *DCount
*DCountA | Ddb | Degrees | DevSq
*DGet | *DMax | *DMin | Dollar
*DProduct | *DStDev | *DStDevP | *DSum
*DVar | *DVarP | Even | ExponDist
Fact | FDist | Find | FindB
FInv | Fisher | FisherInv | Fixed
Floor | Forecast | *Frequency | FTest
Fv | GammaDist | GammaInv | GammaLn
GeoMean | *Growth | HarMean | *HLookup
HypGeomDist | *Index | Intercept | Ipmt
Irr | IsErr | IsError | IsLogical
IsNA | IsNonText | IsNumber | Ispmt
IsText | Kurt | Large | *LinEst
Ln | Log | Log10 | *LogEst
LogInv | LogNormDist | *Lookup | Match
Max | *MDeterm | Median | Min
*MInverse | MIrr | *MMult | Mode
NegBinomDist | NormDist | NormInv | NormSDist
NormSInv | NPer | Npv | Odd
Or | *Parent | Pearson | Percentile
PercentRank | Permut | Pi | Pmt
Poisson | Power | Ppmt | Prob
Product | Proper | Pv | Quartile
Radians | *Rank | Rate | Replace
ReplaceB | Rept | Roman | Round
RoundDown | RoundUp | RSq | Search
SearchB | Sinh | Skew | Sln
Slope | Small | Standardize | StDev
StDevP | StEyx | Substitute | *Subtotal
Sum | *SumIf | SumProduct | SumSq
SumX2MY2 | SumX2PY2 | SumXMY2 | Syd
Tanh | TDist | Text | TInv
Transpose | *Trend | Trim | TrimMean
TTest | USDollar | Var | VarP
Vdb | *VLookup | Weekday | Weibull
ZTest |  |  |


Programming Environment

Microsoft® SQL Server™ OLAP Services supports applications written in Microsoft Visual Basic® and other languages that support the Component Object Model (COM).

The Decision Support Objects (DSO) object model and the add-in program interface were developed in Visual Basic and are easiest to use with that language.

Client applications that use PivotTable® Service to communicate with the OLAP server or to manage local cubes can use OLE DB interfaces for C++ or the Microsoft ActiveX® Data Objects (ADO) and ActiveX Data Objects (Multidimensional) (ADO MD) with any COM automation language, including Visual Basic.

To connect to a data source, you can use OLE DB connection strings for OLE DB-compliant data sources, or establish system data source connections in your computer’s ODBC Data Source Administrator for ODBC-compliant data sources. OLAP Services supports the following relational database products:

  • SQL Server versions 6.5 and 7.0
  • Microsoft Access 97 and later
  • Oracle versions 7.3 and 8.0

The OLAP server, which is included in OLAP Services, can also be used as an OLE DB data source. Data from multidimensional data cubes is presented in tabular form.


Property Object

The Property object provides a mechanism for saving user-defined items to a CustomProperties collection. You can define Property objects and add them to the CustomProperties collection of any Decision Support Objects (DSO) object to store information you want to associate with the DSO object. You provide a name, value, and data type for each Property object.

Remarks

The Property object has properties, but no collections or methods. The Property object is unlike other DSO objects in that it does not implement any of the interfaces, methods, properties, or collections of other DSO objects.

Example

'Assume an object of ClassType clsDimension exists

'Add a custom property

Dim dsoProp As DSO.Property

Set dsoProp = dsoDim.CustomProperties.Add(55, "Age", vbInteger)

'Retrieve custom property values

Dim dsoProp2 As DSO.Property

Set dsoProp2 = dsoDim.CustomProperties(1)

Debug.Print dsoProp2.Name, dsoProp2.Value


Properties, Property Object

A Property object implements the following properties.

Property | Description
DataType | Microsoft® Visual Basic® data type.
Name | Property object name.
Value | Property object value.

Access

Read/write


DataType, Property Object

The DataType property of a Property object contains the Microsoft® Visual Basic® data type of the custom property defined by the Property object.

Data Type

VbVarType (a Visual Basic enumeration)

Access

Read/write

See Also
CustomProperties | Value
Name |


Name, Property Object

The Name property of a Property object contains the unique user-assigned name of the custom property defined by the Property object.

Data Type

String

Access

Read/write

See Also
CustomProperties | Value
DataType |


Value, Property Object

The Value property of a Property object can contain any value that is valid for the DataType defined for the Property object.

Data Type

Variant

Access

Read/write

See Also
CustomProperties | Name
DataType |


SQL in OLAP Services

Microsoft® SQL Server™ OLAP Services is both a multidimensional data provider (MDP) and a tabular data provider (TDP). Therefore, executing a query returns either a multidimensional dataset or a flattened rowset, depending on the query language dialect used. OLAP Services recognizes both the SQL dialect and the multidimensional expressions (MDX)) dialect. For more information, see the OLE DB documentation.

In addition to querying, you can use certain data definition language (DDL) statements to create local cubes, calculated members, user-defined sets, and cache. For more information, see PivotTable Service.


Role Interface

The Role interface supports the maintenance of user groups and security parameters in Microsoft® SQL Server™ OLAP Services version 7.0. Users can be grouped by common access privileges using the Role interface.

In Decision Support Objects (DSO), the objects that implement the Role interface have a ClassType property value of clsCubeRole or clsDatabaseRole. The Role interface provides properties and methods to manipulate these objects.

For more information about database and cube objects and how they relate to each other, see About Decision Support Objects. For a list of the Role interface collections, methods, and properties, see Collections, Methods, and Properties.

Applies To
clsCubeRole clsDatabaseRole


Collections, Role Interface

The Role interface supports the following collection.

Collection | Description
CustomProperties | Collection of user-defined properties.

Applies To
clsCubeRole clsDatabaseRole

Access

Read/write


Methods, Role Interface

The Role interface supports the following methods.

Method | Description
Clone | Copies a database role to another database.
LockObject | Locks a role object.
SetPermissions | Sets role permissions for a given key.
UnlockObject | Unlocks a previously locked role object.
Update | Saves a role in the repository.

Method/Class Cross-Reference

The following table shows the applicability of each method to each object. X indicates applicable, n/a indicates not applicable.

 | clsDatabaseRole | clsCubeRole
Clone | X | n/a
LockObject | X | n/a
SetPermissions | n/a | X
UnlockObject | X | n/a
Update | X | n/a


Clone

The Clone method of the Role interface copies the property values and the collections of a role to a target object of the same class type.

Applies To
clsDatabaseRole

Syntax

object.Clone(TargetObject [, CloneOptions])

object
The clsDatabaseRole object to be copied.
TargetObject
An existing clsDatabaseRole object.
CloneOptions
A member of the CloneOptions enumeration that specifies the options to tell the method the extent to which the source object should be copied. Because Role objects contain no major or minor objects, the entire role is cloned regardless of the option specified - you should either omit the optional CloneOptions argument or specify cloneObjectProperties.
See Also
About Decision Support Objects | Using Decision Support Objects
Methods Cross-Reference |


LockObject

The LockObject method of the Role interface locks a role object to prevent actions of multiple users of the object from colliding.

Applies To
clsDatabaseRole

Syntax

object.LockObject(LockType, LockDescription)

object
The object to lock.
LockType
One of the lock types of the OlapLockTypes enumeration.
LockDescription
A string containing the description of the lock, available to other applications attempting to obtain a lock.
Remarks

For a complete discussion of object locking, see the LockObject method of the MDStore interface.

See Also
About Decision Support Objects | Using Decision Support Objects
UnlockObject | Methods Cross-Reference


SetPermissions

The SetPermissions method of the Role interface sets role permissions for a given key.

Applies To
clsCubeRole

Syntax

bRet = object.SetPermissions(key,PermissionExpression)

bRet
A Boolean variable that receives the completion status of the operation: True if it was completed successfully, False otherwise.
object
The role object on which to set permissions.
key
String containing the permission key.
PermissionExpression
String containing the permission expression for the corresponding key.
Remarks

The Permissions property contains only one permissions key. It is preset with a value of Access. The PermissionExpression for the access key contains the property values R and RW, corresponding to read-only and read/write.

Example

Use the following code to set permissions on an object of ClassType clsCubeRole.

'Assume an object (dsoCubeRole) of ClassType clsCubeRole exists

'Set a read-only permission

dsoCubeRole.SetPermissions "Access", "R"

'Set a read-write permission

dsoCubeRole.SetPermissions "Access", "RW"

See Also
About Decision Support Objects | Using Decision Support Objects
Methods Cross-Reference |


UnlockObject

The UnlockObject method of the Role interface releases a lock on a role object previously established by the LockObject method.

Applies To
clsDatabaseRole

Syntax

object.UnlockObject

object
The role object from which to remove a lock.
Remarks

For a complete discussion of object locking, see the LockObject method in MDStore Interface.

See Also
About Decision Support Objects | Using Decision Support Objects
LockObject | Methods Cross-Reference


Update

The Update method of the Role interface updates the definition of the role object in the metadata repository.

Applies To
clsDatabaseRole

Syntax

object.Update

object
The role object to update.
Remarks

Not all properties are updated for all objects. In the following table, Y indicates that the property is updated, and N indicates that the property is not updated.

Property | clsDatabaseRole | clsCubeRole
Description | Y | N
Name | Y | Y
Permissions | N | Y
UsersList | Y | N

See Also
About Decision Support Objects | Using Decision Support Objects
Methods Cross-Reference |


Properties, Role Interface

The Role interface supports the following properties.

Property | Description
ClassType | Returns an enumeration constant identifying the specific object type.
Description | The description of a role.
IsValid | Indicates whether a role structure is valid.
Name | The name of a role.
Parent | Returns a reference to the parent MDStore object.
Permissions | The role permissions for a given key.
SubClassType | Returns an enumeration constant identifying the subclass type of the object.
UsersList | A semicolon-delimited list of users.

Access Cross- Reference

The following table shows whether the property is read/write (R/W), read-only (R), or not applicable (n/a) for different objects.

Property | clsDatabaseRole | clsCubeRole
ClassType | R | R
Description | R/W | R
IsValid | R | R
Name | R/W (R after the object has been named) | R/W (R after the object has been named)
Parent | R | R
Permissions | R | n/a
SubClassType | R | R
UsersList | R/W | R


ClassType

The ClassType property of the Role interface contains an enumeration constant identifying the specific class type.

Applies To
clsCubeRole clsDatabaseRole

Data Type

ClassTypes (an enumeration)

Values

ClassType is set to one of the following values:

  • clsDatabaseRole
  • clsCubeRole

For a complete list of class types, see Enumerations.

Access

Read-only

Example

Use the following code to return the class type of a role object and determine which object class has been returned:

' Assume the existence of object RoleObject

Dim ClassTyp As ClassTypes

ClassTyp = RoleObject.ClassType

Select Case ClassTyp

   Case clsDatabaseRole

        ' commands for a DatabaseRole object

   Case clsCubeRole

        ' commands for a CubeRole object

   Case Else

        ' other commands

End Select

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference | SubClassType


Description

The Description property of the Role interface contains the description of the role object.

Applies To
clsCubeRole clsDatabaseRole

Data Type

String

Access

The access type depends on the class type of the role object.

Role object class type | Access
clsDatabaseRole | R/W
clsCubeRole | R

Remarks

The primary mechanism for identifying the data in a role object is the Name property. The purpose of the Description property is to provide additional descriptive information.

Example

Use the following code to set a role object description:

RoleObject.Description = "Eastern Region Sales and Marketing"

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


IsValid

The IsValid property of the Role interface indicates whether the role object structure is valid.

Applies To
clsCubeRole clsDatabaseRole

Data Type

Boolean

Access

Read-only

Remarks

A role object is valid if the Name and UsersList properties are not empty strings and it its Parent property is valid.

Example

Use the following code to return a role object validity status:

Dim bRet As Boolean

bRet = RoleObject.IsValid

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


Name

The Name property of the Role interface contains the name of the role object.

Applies To
clsCubeRole clsDatabaseRole

Data Type

String

Access

Read/write (read-only after the object has been named)

Remarks

The primary mechanism for identifying the data in a role object is the Name property. The purpose of the Description property is to provide additional descriptive information.

Example

Use the following code to set a role object name:

RoleObject.Name = "Sales and Marketing"

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


Parent

The Parent property of the Role interface contains a reference to the parent MDStore object.

Applies To
clsCubeRole clsDatabaseRole

Data Type

MDStore

The class type of the parent object depends on the class type of the role object.

Role object class type | Parent object class type
clsDatabaseRole | clsDatabase
clsCubeRole | clsCube

Access

Read-only

Example

Use the following code to return a role object parent to object ParentObject and determine which object class has been returned:

Dim ParentObject As MDStore

Set ParentObject = RoleObject.Parent

Dim ParentClass As ClassTypes

ParentClass = ParentObject.ClassType

Select Case ParentClass

    Case clsDatabase

        ' commands for a Database

    Case clsCube

        ' commands for a Cube

End Select

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


Permissions

The Permissions property of the Role interface contains the role permissions for a specified key.

Applies To
clsCubeRole

Data Type

String

Access

Read-only

Remarks

The Permissions property contains only one permissions key. It is preset with a property value of “Access”. The PermissionExpression for this key contains the property values R and RW, corresponding to read-only and read/write. The Permissions property is supported by the ClassType clsCubeRole only. For more information, see SetPermissions.

Example

Use the following code to return a role object’s permission string:

Dim Perms As String
Perms = RoleObject.Permissions("Access")

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


SubClassType

The SubClassType property of the Role interface contains an enumeration constant identifying the subclass type of the object.

Applies To
clsCubeRole clsDatabaseRole

Data Type

SubClassTypes (an enumeration)

Access

Read-only

Remarks

Objects that implement the Role interface, that is, those of ClassType clsCubeRole or clsDatabaseRole, can have a SubClassType property of sbclsRegular only. For more information, see SubClassTypes in Enumerations.

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference | ClassType


UsersList

The UsersList property of the Role interface contains a semicolon-delimited list of users.

Applies To
clsCubeRole clsDatabaseRole

Data Type

String

Access

The access type depends on the class type of the role object.

Role object class type | Access
clsDatabaseRole | R/W
clsCubeRole | R

Remarks

The name for a user list must be qualified with the appropriate domain name. The general format is “<domain>\<user>“.

Example

Use the following code to set the list of users of a role object:

RoleObject.UsersList = "Domain1\Ejones;Domain1\Bsmith;Domain2\RGreen"

See Also
About Decision Support Objects | Using Decision Support Objects
Properties Cross-Reference |


About Decision Support Objects

Decision Support Objects (DSO) exposes the object model for the OLAP server. DSO contains interfaces, objects, collections, methods, and properties. Groups of objects are hierarchically arranged to define OLAP elements such as databases, cubes, partitions, and aggregations. Objects defined using DSO embody the metadata of the OLAP data managed by the OLAP server. This metadata is stored in a repository in a relational database and is accessed by the OLAP server and DSO.

Conceptually, DSO uses hierarchically arranged groups of objects to define basic elements of OLAP data storage, as implemented by the server. These basic elements are databases, cubes, partitions, aggregations, and virtual cubes. DSO addresses these basic elements in a hierarchical structure where elements contain other elements in a tree, which has the server object at the root of the tree. Other objects support this basic structure for dimensions, levels, measures, roles, and so forth.

The server object contains groups of objects that define databases accessed by the server. Each database element can contain groups of objects that define cubes or virtual cubes. A cube contains one or more partitions, which contain aggregations. A virtual cube is a special case of a cube, combining portions of its contained cubes, similar to the way a relational database view combines portions of tables.

Each of the above elements contains collections and objects. A special collection, named MDStores, maintains references to objects that make up the elements of this hierarchy beneath the server. The MDStores collection provides special implementations of Add, Find, and Remove methods, and a convenient AddNew method, which maintain parent-child relationships among the objects. Items in an MDStores collection are identified by the value of their ClassType property. For example, objects in an MDStores collection that have a ClassType property value of clsCube are cube objects.

Databases, cubes, partitions, and aggregations expose a common interface, MDStore, that provides the methods and properties you use to manipulate the objects. For more information about this interface, see MDStore Interface.

This figure shows an expanded view of the DSO structure and includes the basic Dimensions and Measures members that are key to the storage and definition of data cubes.

For more information about the DSO elements in this structure and the repository, see Databases, Cubes, Partitions, Aggregations, Virtual Cubes, and Repository.

Objects and Interfaces

There are two major classifications of DSO objects:

  • Those that can be accessed and managed directly. These have their own collections, methods and properties, and include the following classes.

    clsCubeAnalyzer clsPartitionAnalyzer
    clsDataSource clsServer
    clsMemberProperty

  • Those that implement a DSO interface. The following table lists the six DSO interfaces and the DSO objects that implement them. You must use the interfaces rather than manipulating these objects directly.
Interface | Implemented by
Command | clsDatabaseCommand clsCubeCommand
Dimension | clsDatabaseDimension clsCubeDimension clsPartitionDimension clsAggregationDimension
Level | clsDatabaseLevel clsCubeLevel clsPartitionLevel clsAggregationLevel
MDStore | clsDatabase clsCube clsPartition clsAggregation
Measure | clsCubeMeasure clsPartitionMeasure clsAggregationMeasure
Role | clsDatabaseRole clsCubeRole

For more information, see Objects and Interfaces.


Databases, Decision Support Objects

A database in the Decision Support Objects (DSO) contains these collections: Dimensions and their subordinate Levels collections, Datasources, Roles, Commands, and CustomProperties. Databases also contain an MDStores collection of cubes and virtual cubes. Databases are contained in an MDStores collection under the server object. Objects in this collection are identified by their ClassType property, which has a value of clsDatabase. These database objects contain collections as shown in the following figure.

The Dimensions collection in a database contains shared and private dimensions and their subordinate levels. Shared dimensions can be used in multiple cubes; private dimensions can be used only in the cube to which they apply. Both shared and private dimensions can be modified only in the Dimensions collection of a Database object.

The Datasources collection in a database contains the data sources applicable to all subordinate objects in the database.

The Roles collection in a database contains Role objects that specify access rights for authorized users. Roles can be applied to elements such as databases and cubes.

The Commands collection in a database is reserved for future use.

The CustomProperties collection contains Property objects that you can use to define additional properties for your own purposes.

The MDStores collection in a database can contain cubes and virtual cubes.

See Also
Cubes Virtual cubes


Cubes, Decision Support Objects

A cube in Decision Support Objects (DSO) contains these collections: Dimensions and their subordinate Levels collections, Measures, Datasources, Roles, Commands, CustomProperties, and an MDStores collection containing one or more partitions. Cubes contain collections of members as shown in the following figure.

The Dimensions collection in a cube contains the definitions of the dimensions used by the cube. Private dimensions can be defined in the Dimensions collection, but can be modified only in the cube’s parent database Dimensions collection. Shared dimensions defined in the cube’s parent database can also be used in the cube and can be added to the cube’s Dimensions collection. Shared dimensions assigned to a cube refer to the dimension definitions in the parent database and cannot be modified within the context of the cube.

The Measures collection in a cube contains the measures associated with the cube.

The Datasources collection in a cube contains the definition of the default data source used for the cube’s partitions and dimensions. A cube can use only a single data source.

The Roles collection in a cube contains access rights to the cube definition. Only roles that are contained in a cube’s parent database can be assigned to the cube.

The Commands collection in a cube contains MDX expressions that are used to specify the data to be used in the cube.

The CustomProperties collection contains Property objects that you can use to define additional properties for your own purposes.

The MDStores collection in a cube contains one or more partitions of a cube.

See Also
Databases Partitions


Partitions, Decision Support Objects

Every cube has at least one partition, its default partition. Additional partitions can be defined so that portions of a cube’s data can be stored in different locations. A partition contains these collections: Dimensions and their subordinate Levels collection, Measures, Datasources, CustomProperties, and an MDStores collection containing aggregations.

The Dimensions collection in a partition contains the cube dimensions stored in the partition.

The Measures collection in a partition contains the measures for the partition. A measure's definition in the partition’s Measures collection will default to its definition in the partition’s parent cube.

The Datasources collection in a partition specifies the data source for the partition. Each partition can specify its own data source or inherit the parent cube’s default data source.

The CustomProperties collection contains Property objects that you can use to define additional properties for your own purposes.

The MDStores collection in a partition contains the aggregations associated with the partition.

See Also
Aggregations Cubes


Aggregations, Decision Support Objects

Aggregations contain these collections: Dimensions and their subordinate Levels collection, Measures, Datasources, and CustomProperties.

The Dimensions collection in an aggregation contains the definitions of the dimensions used by the aggregation.

The Measures collection in an aggregation contains the measures to be used in aggregation calculations.

The Datasources collection in an aggregation specifies the locations of data to be aggregated.

The CustomProperties collection contains Property objects that you can use to define additional properties for your own purposes.

See Also

Partitions


Virtual Cubes, Decision Support Objects

Virtual cubes join cubes in a manner conceptually similar to the way relational views join tables. Virtual cubes contain these collections: Dimensions and their subordinate Levels collection, Measures, Roles, Commands, CustomProperties, and an MDStores collection. The MDStores collection of a virtual cube contains the cubes that supply information to be included in the virtual cube.

A virtual cube is a special case of a cube and is like a cube in many ways. Virtual cubes have the same collections as cubes except that virtual cubes do not have a Datasources collection, and a virtual cube’s MDStores collection contains cubes whereas a cube’s MDStores collection contains partitions. A virtual cube object has its SubClassType property set to sbclsVirtual, in contrast to sbclsRegular for regular cubes.

A virtual cube is restricted in that all of its dimensions or measures must be present in one or more of the underlying cubes. Like cubes, a virtual cube’s roles must come from its parent database. You can use a role on a virtual cube to expose data from underlying cubes to users who do not have permission to read data from the underlying cubes.

The Dimensions collection in a virtual cube contains the definitions of the dimensions used by the virtual cube. These dimensions must exist in at least one of the cubes that make up the virtual cube.

The Measures collection in a virtual cube contains the measures associated with the virtual cube. These measures must exist in at least one of the cubes that make up the virtual cube.

The Roles collection in a virtual cube contains access rights to the virtual cube definition. Only roles that are contained in a virtual cube’s parent database can be assigned to the virtual cube.

The Commands collection in a virtual cube contains MDX expressions that are used to specify the data to be used in the virtual cube.

The CustomProperties collection contains Property objects that you can use to define additional properties for your own purposes.

The MDStores collection in a virtual cube contains one or more cubes.

See Also
Cubes Databases


Repository, Decision Support Objects

The repository is the storage container for the metadata managed by Decision Support Objects (DSO). Metadata is stored in tables in a relational database. Metadata in the repository is automatically updated by DSO as you manipulate objects and their properties.

The design of the repository’s data storage tables is for internal use only and subject to change in future releases. We strongly recommend you use only the OLAP Manager user interface or DSO to manage metadata and not attempt to manipulate data in the repository directly. A repository with inconsistent or missing data may become unusable and difficult or impossible to repair.

You can migrate the repository from its default installation location to a Microsoft® SQL Server™ version 7.0 database. For more information, see Migrating OLAP Services Repositories.


Collections

Collections used in Microsoft® SQL Server™ Decision Support Objects (DSO) operate in general the way standard Microsoft Visual Basic® collections do, but there are several differences in the way they are used within DSO. DSO collections contain methods and properties that have implementations specifically designed for the DSO object model.

Unlike typical Visual Basic collections, DSO collections can contain only objects of the same type. For example, a Dimensions collection can contain only objects of the object classes that apply to dimensions, such as ClassType clsDatabaseDimension, clsCubeDimension, clsPartitionDimension, and clsAggregationDimension. A collection’s parent object determines the specific ClassType property value for the collection. For example, a Dimensions collection whose parent is of ClassType clsDatabase can contain only objects of ClassType clsDatabaseDimension.

A collection is considered to be static for an object if the range of acceptable objects in the collection is restricted. For example, the Roles collection for an object of ClassType clsCube is a static collection because it can only contain role objects that are defined for the cube’s parent database object.

The following table lists the collections used in the DSO object model. With the exception of CustomProperties, all collections implement the methods and properties listed in Collection Methods and Collection Properties.

Collection | Contains objects of ClassType
Commands | clsCubeCommand clsDatabaseCommand
CustomProperties | Property Object (ClassType does not apply)
DataSources | clsDatasource
Dimensions | clsAggregationDimension clsCubeDimension clsDatabaseDimension clsPartitionDimension
Levels | clsAggregationLevel clsCubeLevel clsDatabaseLevel clsPartitionLevel
MDStores | clsAggregation clsCube clsDatabase clsPartition
Measures | clsAggregationMeasure clsCubeMeasure clsPartitionMeasure
MemberProperties | clsMemberProperty
Roles | clsCubeRole clsDatabaseRole

For methods and properties that apply to the CustomProperties collection, see CustomProperties.

See Also
Collections Cross-Reference | Nested Collections
Collection Methods | Collection Properties


Nested Collections

For members of a collection that is itself a collection of an object contained in another collection, you can use an intermediate object to access each collection. For example, if object dsoObject has a collection Collection1 that contains objects of type dsoObject1, each of which in turn has a collection Collection2 that contains objects of type dsoObject2, you can access properties of dsoObject2 objects by setting a temporary object to the intermediate dsoObject1.

Dim TempObject, TempProp

' Retrieve the first level object

Set TempObject = dsoObject.Collection1(i)

' Retrieve the property

TempProp = TempObject.Collection2(j).property

Access to the property directly through nested collection references is not implemented in Decision Support Objects (DSO) collections. For example, the following statement will produce an error:

TempProp = dsoObject.Collection1(i).Collection2(j).property


Methods

The following methods apply to Decision Support Objects (DSO) collections.

Method | Description
Add | Adds an existing object to a collection.
AddNew | Creates and adds a new object to a collection.
Find | Determines whether a specified object is in a collection.
Item | Retrieves an object from a collection.
Remove | Removes an object from a collection.

Note These methods do not apply to CustomProperties collections. For more information, see CustomProperties.


Add

The Add method of a Decision Support Objects (DSO) collection adds an object to the collection. This method does not apply to CustomProperties collections.

Note It is recommended that you use the AddNew method when adding new objects, and only use the Add method when adding existing objects, such as when adding aggregations to a partition after you have designed aggregations. For more information, see clsPartitionAnalyzer.

Syntax

colCollection.Add(Item, [sKey], [before])

colCollection
An instance of a DSO collection object.
Item
An expression that specifies the member to add to the collection.
sKey
Reserved. Defaults to Item.Name. If specified, must contain the value of the item’s Name property.
before
Optional. An expression that specifies a relative position in the collection. The member to be added is placed in the collection before the member identified by the before argument. The value of before must be a number from 1 to the value of the colCollection.Count property. If you omit this parameter, the item is appended at the last position in the collection.

Note All collections in the DSO object model are one-based. That is, the first item in the collection has an index of 1 and the last item has an index of Count.


AddNew

The AddNew method of a Decision Support Objects (DSO) collection creates and adds an object to a collection.

Syntax

colCollection.AddNew(Name, [SubClassType])

colCollection
An instance of a DSO collection object.
Name
A string that specifies the name of the new object to add to the collection.
SubClassType
Optional. One of the values enumerated by the SubClassTypes enumeration. The default value is sbclsRegular.
Remarks

The ClassType property of the new object is set automatically and depends on the parent of the collection to which the object is being added. For example, objects added to the MDStores collection of an object of ClassType clsDatabase automatically receive a ClassType value of clsCube.

The AddNew method maintains hierarchical relationships and ordering within the collection.

Note The AddNew method should be used when adding new objects to a collection. The Add method is recommended for use only when adding existing objects to a collection, such as when adding aggregations to a partition after you have designed aggregations. For more information, see clsPartitionAnalyzer.

Example

Use the following code to create a new cube and add it to the MDStores collection of cubes:

' Assume the existence of an object objDB

' of ClassType clsDatabase

Dim objNewCube As MDStore

Set objNewCube = objDB.MDStores.AddNew("NewCube")


Find

The Find method of a Decision Support Objects (DSO) collection locates an item in a collection. This method does not apply to CustomProperties collections.

Syntax

bIsThere = colCollection.Find(vKey)

bIsThere
A Boolean variable that receives the returned value: True if the item was found, False otherwise.
colCollection
An instance of a DSO collection object.
vKey
The key or index of the item to be found.
Example

Use the following code to check for the existence of a partition named “EastCoast” in the MDStores collection of partitions for a cube:

' Assume the existence of an object cubCube

' of ClassType clsCube

Dim bDoesItExist As Boolean

bDoesItExist = cubCube.MDStores.Find("EastCoast")


Item

The Item method of a Decision Support Objects (DSO) collection returns an instance of an item in the collection. This method does not apply to CustomProperties collections.

Syntax

Set vnt = colCollection.Item(vntIndexKey)

vnt
A variant variable that receives the instance of the member. Instead of a variant, you can use a variable that has been declared to match the object being retrieved from the collection. For example, a variable declared as type MDStore, with its ClassType property value set to clsCube, can be used to retrieve an object from an MDStores collection of clsCube objects.
colCollection
An instance of a DSO collection object.
vntIndexKey
Can be either the index (integer) or key (string) to the collection.

Note All collections in the DSO object model are one-based. That is, the first item in the collection has an index of 1 and the last item has an index of Count.

Example

Use the following code to return the partition named “EastCoast” from the MDStores collection of partitions for a cube:

' Assume the existence of an object cubCube

' of ClassType clsCube

Dim Temp_Partition As MDStore

' Retrieve using the key

Set Temp_Partition = cubCube.MDStores.Item("EastCoast")

' OR Retrieve using the Index

Set Temp_Partition = cubCube.MDStores.Item(2)


Remove

The Remove method of a Decision Support Objects (DSO) collection removes an item from the collection. This method does not apply to CustomProperties collections.

Syntax

colCollection.Remove(vntIndexKey)

colCollection
An instance of a DSO collection object.
vntIndexKey
Either the index (integer) or key (string) to the collection.

Note All collections in the DSO object model are one-based. That is, the first item in the collection has an index of 1 and the last item has an index of Count.

Example

Use the following code to remove the partition named “EastCoast” from the MDStores collection of partitions for a cube:

' Assume the existence of an object dsoCube

' of ClassType clsCube

' Remove using the key

dsoCube.MDStores.Remove "EastCoast"

' OR Remove using the Index

dsoCube.MDStores.Remove 2


Properties

The following properties apply to Decision Support Objects (DSO) collections.

Property | Description
ClassType | The class type of a collection.
ContainedClassType | The class type of the items contained in a collection.
Count | The number of items in a collection.

Note These properties do not apply to CustomProperties collections. For more information, see CustomProperties.


ClassType

The ClassType property of a Decision Support Objects (DSO) collection returns the class type of the collection object. This property does not apply to CustomProperties collections.

Data Type

ClassTypes (an enumeration)

Values

clsCollection for all collections

Access

Read-only

See Also
clsDatasource | Level Interface
Command Interface | MDStore Interface
Dimension Interface | Role Interface


ContainedClassType

The ContainedClassType property of a Decision Support Objects (DSO) collection returns the class type of the items contained within the collection. This property does not apply to CustomProperties collections.

Data Type

ClassTypes (an enumeration)

Values

ClassTypes enumeration.

Range

Any valid value in the ClassTypes enumeration.

Default

n/a

Access

Read-only

Remarks

The Decision Support Objects (DSO) object model uses the properties ClassType and SubClassType to identify the object. All DSO objects, with the exception of those of ClassType clsCube and clsLevel return a SubClassType of sbclsRegular. In addition to sbclsRegular, an object of ClassType clsCube or clsLevel can have a SubClassType of sbclsVirtual, which identifies the object as a virtual cube or a virtual (calculated) level.

Example

Use the following code to return a collection object’s ContainedClassType and determine which class type has been returned:

Dim ctVar As ClassTypes

ctVar = CollectionObject.ContainedClassType

Select Case ctVar

   Case clsCubeMeasure

      ' commands for a CubeMeasure

   Case clsCubeDimension

      ' commands for a CubeDimension

   Case clsCubeLevel

      ' commands for a CubeLevel

   Case clsCubeCommand

      ' commands for a CubeCommand

   Case clsCubeRole

      ' commands for a CubeRole

   *

   *

   *

   Case Else

        ' other commands

End Select

See Also
clsDatasource | Level Interface
Command Interface | MDStore Interface
Dimension Interface | Role Interface


Count

The Count property of a Decision Support Objects (DSO) collection returns the number of items in the collection. This property does not apply to CustomProperties collections.

Data Type

Integer

Access

Read-only

Note All collections in the Decision Support Objects (DSO) object model are one-based. That is, the first item in the collection has an index of 1 and the last item has an index of Count.

Example

Use the following code to return the number of cubes in an MDStores collection of cubes.

'Assume an object (dsoDB) of ClassType clsDatabase exists

Dim dsoCube As DSO.MDStore

Dim cubeCounter As Integer

For cubeCounter = 1 to dsoDB.MDStores.Count

    Set dsoCube = dsoDB.MDStores(cubeCounter)

    Debug.Print "      Cube Name: " & dsoCube.Name

Next cubeCounter


Commands Collection

A Command object encapsulates a user-defined command or sequence of commands that are automatically executed on the Microsoft® SQL Server™ OLAP Services client when the user accesses the cube or database. Such commands can include calculated members, named sets, library references, and so on.

Objects of each of the following ClassTypes contain a Commands collection:

  • clsCube
  • clsDatabase

Each Commands collection contains command objects of the same class type. The ContainedClassType property of a Commands collection specifies the class type of the contained objects.

CmdObject.ClassType | cmdObject.Commands.ContainedClassType
clsCube | clsCubeCommand
clsDatabase | clsDatabaseCommand

Remarks

The relative position of commands within a Commands collection determines the order in which the commands are executed. This is important because it is possible to write commands that are dependent upon previous commands in the collection. For example, a named set can contain a previously-defined calculated member.

As with other Decision Support Objects (DSO) collections, the Add, AddNew, Find, and Remove methods of Commands collections maintain all necessary parent-child relationships among the objects in the object model.

Note The Commands collection of clsDatabase objects is reserved for future use.

See Also
About Decision Support Objects | Collections
Collection Methods | Collection Properties


CustomProperties Collection

The CustomProperties collection applies to all Decision Support Objects (DSO) objects and enables you to define unique properties for DSO objects. The CustomProperties collection contains Property objects that you define to store information you want to associate with a DSO object. For more information about defining custom properties, see Property Object.

Access

Read/write

Remarks

The CustomProperties collection implements its own methods and properties, which operate differently than those of other DSO collections. For more information, see Methods, CustomProperties and Properties, CustomProperties.

Example

' Assume the existence of an object of ClassType clsDimension

' Add a custom property

  Dim dsoProp As DSO.Property

  Set dsoProp = dsoDim.CustomProperties.Add(55, "Age", vbInteger)

' Retrieve custom property values

  Dim dsoProp2 As DSO.Property

  Set dsoProp2 = dsoDim.CustomProperties(1)

  Debug.Print dsoProp2.Name, dsoProp2.Value

See Also
About Decision Support Objects Collections


Methods, CustomProperties

The following methods apply to CustomProperties collections. They do not apply to other Decision Support Objects (DSO) collections.

Note These methods apply only to CustomProperties collections. For information about methods for other DSO collections, see Collection Methods.

Method | Description
Add | Adds a Property object to a CustomProperties collection.
Clear | Clears all Property objects from a CustomProperties collection.
Item | Retrieves a Property object from a CustomProperties collection.
Remove | Removes a Property object from a CustomProperties collection.


Add, CustomProperties

The Add method of a CustomProperties collection creates a new Property object, adds it to the collection, and returns a reference to the object. This method applies only to CustomProperties collections.

Syntax

Set vnt = colCPcollection.Add(Value, [Name], [DataType])

vnt
A variant variable that receives the instance of the new Property object. Instead of a variant, you can use a variable that has been declared as type DSO.Property to match the object being retrieved from the collection.
colCPcollection
An instance of a CustomProperties collection.
Name
Optional. A string that specifies the name of the Property object.
DataType
The data type of the property. A Microsoft® Visual Basic® data type specified by VbVarType (a Visual Basic enumeration).


Clear, CustomProperties

The Clear method of a CustomProperties collection clears the collection of all entries. This method applies only to CustomProperties collections.

Syntax

colCPcollection.Clear


Item, CustomProperties

The Item method of a CustomProperties collection returns an instance of an item in the collection. This method applies only to CustomProperties collections.

Syntax

Set vnt = colCollection.Item(vntIndex)

vnt
A variant variable that receives the instance of the new Property object. Instead of a variant, you can use a variable that has been declared as type DSO.Property to match the object being retrieved from the collection.
colCollection
An instance of a DSO collection object.
vntIndex
A variant that specifies the name or index of the object to retrieve.


Remove, CustomProperties

The Remove method of a CustomProperties collection removes an item from the collection. This method applies only to CustomProperties collections.

Syntax

colCollection.Remove(vntIndex)

colCollection
An instance of a DSO collection object.
vntIndex
A variant that specifies the name or index of the object to remove.


Properties, CustomProperties

The following properties apply to CustomProperties collections. They do not apply to other Decision Support Objects (DSO) collections.

Property | Description
Count | The number of Property objects in a CustomProperties collection.


Count, CustomProperties

The Count property of a CustomProperties collection returns the number of items in the collection. This property applies only to CustomProperties collections.

Data Type

Integer

Access

Read-only


DataSources Collection

A DataSources collection in a Decision Support Objects (DSO) object contains the data sources that are or can be used by the subordinate objects in the object.

Each of the following objects contains a DataSources collection:

  • clsCube
  • clsDatabase

Each subordinate object, that is cubes, partitions, or shared dimensions, can have a unique data source. For example, although a cube can contain only one data source in its DataSources collection, each partition or shared dimension within the cube can have a unique data source.

Regardless of the object in which it resides, each DataSources collection contains objects of ClassType clsDatasource.

Remarks

The DataSources collection contains the name, connection string, and other information used to attach to a data provider.

Note An object of ClassType clsDatabase may have more than one data source contained in the DataSources collection, while an object of ClassType clsCube can contain only one data source in its DataSources collection.

See Also
About Decision Support Objects | Collections
Collection Methods | Collection Properties


Dimensions Collection

A Dimensions collection holds the dimension definitions for a Decision Support Objects (DSO) object. Each of the following objects contains a Dimensions collection:

  • clsDatabase
  • clsCube
  • clsPartition
  • clsAggregation

Each Dimensions collection contains dimension objects of the same class type. The ContainedClassType property of a Dimensions collection specifies the class type of the contained objects.

Object.ClassType | Object.Dimensions.ContainedClassType
clsAggregation | clsAggregationDimension
clsCube | clsCubeDimension
clsDatabase | clsDatabaseDimension
clsPartition | clsPartitionDimension

Remarks

As with other collections in the DSO object model, the AddNew, Find, and Remove methods of Dimensions collections maintain all necessary parent-child relationships among the objects in the object model.

See Also
About Decision Support Objects | Collections
Collection Methods | Collection Properties


Levels Collection

The Levels collections holds the level definitions for a Decision Support Objects (DSO) object. Each of the following objects implements the Dimension interface and contains a Levels collection:

  • clsDatabaseDimension
  • clsCubeDimension
  • clsPartitionDimension
  • clsAggregationDimension

Each Levels collection contains level objects of the same class type. The ContainedClassType property of a Levels collection specifies the class type of the contained objects.

Object.ClassType | Object.Levels.ContainedClassType
clsAggregationDimension | clsAggregationLevel
clsCubeDimension | clsCubeLevel
clsDatabaseDimension | clsDatabaseLevel
clsPartitionDimension | clsPartitionLevel

Remarks

As with other collections in the DSO object model, the AddNew, Find, and Remove methods of Levels collections maintain all necessary parent-child relationships among the objects in the object model.

See Also
About Decision Support Objects | Collections
Collection Methods | Collection Properties


MDStores Collection

The MDStores collection holds objects that implement the MDStore interface. For example, a myDatabase.MDStores collection contains objects of ClassType clsCube, and a myCube.MDStores collection contains objects of ClassType clsPartition. For more information about this hierarchy, see About Decision Support Objects.

Each of the following objects contains an MDStores collection:

  • clsServer
  • clsCube
  • clsDatabase
  • clsPartition

Each MDStores collection contains MDStore objects of the same class type, except as noted below. The ContainedClassType property of an MDStores collection specifies the class type of the contained objects.

Object.ClassType | Object.MDStores.ContainedClassType
clsCube | clsPartition
clsDatabase | clsCube (see exception below)
clsPartition | clsAggregation
clsServer | clsDatabase

Note The MDStores collection of an object of ClassType clsDatabase contains objects of ClassType clsCube. The ContainedClassType property of this MDStores collection will return clsCube regardless of whether the objects are regular or virtual cubes. In this case you must check the SubClassType property of each object to determine whether it is sbclsRegular or sbclsVirtual.

Remarks

As with other collections in the Decision Support Objects (DSO) object model, the AddNew, Find, and Remove methods of MDStores collections maintain all necessary parent-child relationships among the objects in the object model.

See Also
About Decision Support Objects | Collections
Collection Methods | Collection Properties


Measures Collection

The Measures collection holds the measure definitions for a Decision Support Objects (DSO) object. Each of the following objects implements the MDStore interface and contains a Measures collection:

  • clsCube
  • clsPartition
  • clsAggregation

Each Measures collection contains measure objects of the same class type. The ContainedClassType property of a Measures collection specifies the class type of the contained objects.

Object.ClassType | Object.Levels.ContainedClassType
clsAggregation | clsAggregationMeasure
clsCube | clsCubeMeasure
clsPartition | clsPartitionMeasure

Remarks

As with other DSO collections, the AddNew, Find, and Remove methods of Measures collections maintain all necessary parent-child relationships among the objects in the object model.

See Also
About Decision Support Objects | Collections
Collection Methods | Collection Properties


MemberProperties Collection

The MemberProperties collection contains objects of ClassType clsMemberProperty. Member properties apply to level objects accessed through the Level Interface, including objects of ClassType clsCubeLevel, clsDatabaseLevel, and clsPartitionLevel, but not to objects of ClassType clsAggregationLevel.

See Also
About Decision Support Objects | Collections
Collection Methods | Collection Properties


Roles Collection

The Roles collection holds the user role definitions for a DSO object. Each of the following objects contains a Roles collection:

  • clsDatabase
  • clsCube

Each Roles collection contains role objects of the same class type. The ContainedClassType property of a Roles collection specifies the class type of the contained objects.

Object.ClassType | Object.Roles.ContainedClassType
clsCube | clsCubeRole
clsDatabase | clsDatabaseRole

Remarks

As with other Decision Support Objects (DSO) collections, the AddNew, Find, and Remove methods of Roles collections maintain all necessary parent-child relationships among the objects in the object model.

Note The UsersList property is maintained by clsDatabaseRole and the Permissions property is maintained by clsCubeRole.

See Also
About Decision Support Objects | Collections
Collection Methods | Collection Properties


Collections Cross-Reference

The following collections are used in the various objects within Decision Support Objects (DSO).

Collection | Applies to | Interface | Description
Commands | clsCube clsDatabase | MDStore | Collection of Command objects.
CustomProperties | clsDatasource | n/a | User-defined property.
CustomProperties | clsCubeCommand clsDatabaseCommand | Command | User-defined property.
CustomProperties | clsAggregationDimension clsCubeDimension clsDatabaseDimension clsPartitionDimension | Dimension | User-defined property.
CustomProperties | clsAggregationLevel clsCubeLevel clsDatabaseLevel clsPartitionLevel | Level | User-defined property.
CustomProperties | clsAggregation clsCube clsDatabase clsPartition | MDStore | User-defined property.
CustomProperties | clsAggregationMeasure clsCubeMeasure clsPartitionMeasure | Measure | User-defined property.
CustomProperties | clsCubeRole clsDatabaseRole | Role | User-defined property.
CustomProperties | clsMemberProperty | n/a | User-defined property.
CustomProperties | clsServer | n/a | User-defined property.
DataSources | clsCube (excluding virtual cubes) clsDatabase clsPartition | MDStore | Collection of DataSource objects.
DesignedAggregations | clsPartitionAnalyzer | n/a | Collection of designed aggregations.
Dimensions | clsAggregation clsCube clsDatabase clsPartition | MDStore | Collection of Dimension objects.
Levels | clsAggregationDimension clsCubeDimension clsDatabaseDimension clsPartitionDimension | Dimension | Collection of Level objects.
MDStores | clsServer | n/a | Collection of MDStore objects.
MDStores | clsAggregation clsCube clsDatabase clsPartition | MDStore |
Measures | clsAggregation clsCube clsPartition | MDStore | Collection of Measure objects.
MemberProperties | clsCubeLevel clsDatabaseLevel clsPartitionLevel | Level | Collection of objects of ClassType clsMember Property.
Roles | clsCube clsDatabase | MDStore | Collection of Role objects.


Enumerations

The Microsoft® SQL Server™ OLAP Services Decision Support Objects (DSO) object model provides a number of enumerations. For example, the following code uses the ClassTypes enumeration to retrieve the class type of an object and determine whether the object is a cube, a virtual cube, or some other object:

' Assume that the object dsoServer of ClassType clsServer exists

Dim dsoDB as MDStore

Dim dsoCube as MDStore

Dim CubeCounter as Integer

Set dsoDB = dsoServer.MDStores(1)

For CubeCounter = 1 To dsoDB.MDStores.Count

  Set dsoCube = dsoDB.MDStores(CubeCounter)

  Debug.Print "  Cube: " & dsoCube.Name

  If dsoCube.SubClassType = sbclsRegular Then

    Debug.Print "       SubClassType: Regular"

    Debug.Print "        SourceTable: " & dsoCube.SourceTable

  Else

    Debug.Print "       SubClassType: Virtual"

  End If

Next CubeCounter

Enumerator | Description
AggregatesTypes | Enumerates values for the AggregateFunction property.
ClassTypes | Enumerates values for the ClassType property.
CloneOptions | Enumerates options for the Clone method.
CommandTypes | Enumerates values for the CommandType property.
DimensionAggUsageTypes | Enumerates values for the AggregationUsage property.
DimensionTypes | Enumerates values for the DimensionType property.
ErrorCodes | Enumerates error codes.
LevelTypes | Enumerates values for the LevelType property.
OlapEditions | Enumerates values for the Edition property.
OLAPLockTypes | Enumerates values for the LockType parameter of the LockObject method.
OlapStateTypes | Enumerates values for the State property.
OlapStorageModes | Enumerates values for the OlapMode property.
OrderTypes | Enumerates values for the Ordering property.
ProcessTypes | Enumerates values for the Option parameter of the Process method.
ServerStates | Enumerates values for the State property.
SubClassTypes | Enumerates values for the SubClassType property.


AggregatesTypes

Enumerates values for the AggregateFunction property. For information about objects and interfaces to which this property applies, see the AggregateFunction entries in Properties Cross-Reference.

AggregateFunction | Function
aggCount | Count
aggMax | Max
aggMin | Min
aggSum | Sum


ClassTypes

Enumerates values for the ClassType property used by objects in Microsoft® SQL Server™ OLAP Services Decision Support Objects (DSO). For information about objects and interfaces to which this property applies, see the ClassType entries in Properties Cross-Reference.

ClassType | Description
clsAggregation | Provides a specific implementation of the MDStore interface. Each instance is used to maintain a unique aggregation data store.
clsAggregationDimension | Provides a specific implementation of the Dimension interface. Each instance reviews the dimension collection of objects contained within an aggregation object.
clsAggregationLevel | Provides a specific implementation of the Level interface. Each instance is used to maintain the level objects within an aggregation object.
clsAggregationMeasure | Provides a specific implementation of the Measure interface. Each instance is used to maintain the measure objects contained within an aggregation object.
clsCollection | Similar to a standard Microsoft Visual Basic® collection; however, objects of ClassType clsCollection can contain only objects of the same type.
clsCube | Provides a specific implementation of the MDStore interface. Objects of ClassType clsCube provide the primary data storage mechanism in OLAP Services.
clsCubeAnalyzer | An object of ClassType clsCubeAnalyzer contains a single method used to extract information from the query log. The query log stores the descriptions of queries executed on the OLAP server.
clsCubeCommand | Provides a specific implementation of the Command interface. Each instance encapsulates a user-defined command that is automatically executed at the client when the cube containing the command is accessed.
clsCubeDimension | Provides a specific implementation of the Dimension interface. Cube dimensions are associated with the dimensions (shared and private) of a database.
clsCubeLevel | Provides a specific implementation of the Level interface. Levels define the granularity of their parent dimension.
clsCubeMeasure | Provides a specific implementation of the Measure interface. A cube measure corresponds to a numerically-valued column in a cube’s fact table.
clsCubeRole | Provides a specific implementation of the Role interface. Objects of ClassType clsCubeRole are used to manage the permissions a set of users has when accessing a cube.
clsDatabase | Provides a specific implementation of the MDStore interface. In general, a database contains cubes, which in turn contain partitions, which may in turn contain dimensions, levels, measures, and aggregations. A database may also contain virtual cubes.
clsDatabaseCommand | Provides a specific implementation of the Command interface. Each instance encapsulates a user-defined command that is automatically executed at the client when the cube containing the command is accessed.
clsDatabaseDimension | Provides a specific implementation of the Dimension interface. Database dimensions can be shared or private. A shared database dimension can be associated with any number of cubes; however, a private dimension can be associated with only one cube.
clsDatabaseLevel | Provides a specific implementation of the Level interface. Levels define the granularity of their parent dimension. When you add a dimension to a cube, it inherits whatever levels are defined for the database dimension.
clsDatabaseRole | Provides a specific implementation of the Role interface. Objects of ClassType clsDatabaseRole are used to manage the set of users who can access the database.
clsDatasource | Objects of ClassType clsDatasource are used to specify an external database that will be used as a source of data for OLAP Services databases, cubes, and partitions.
clsPartition | Provides a specific implementation of the MDStore interface. Partitions are common to large data warehouses where massive amounts of data must be managed efficiently. Partitions enable you to segment your data in various storage modes and on various servers.
clsPartitionAnalyzer | Encapsulates an algorithm for automatically designing a set of aggregations in a partition. Aggregations are precalculated data for a cube. Aggregations support rapid and efficient querying of a multidimensional database.
clsPartitionDimension | Provides a specific implementation of the Dimension interface. Each instance is used to maintain the dimension objects contained within a partition.
clsPartitionLevel | Provides a specific implementation of the Level interface. Each instance is used to maintain the level objects that are contained within a partition object.
clsPartitionMeasure | Provides a specific implementation of the Measure interface. Each instance is used to maintain the measure objects that are contained within a partition object.
clsServer | Provides methods and properties that enable you to control an OLAP server. The object is the root of the DSO object model tree.


CloneOptions

Enumerates options for the Clone method. For more information about objects and interfaces to which this method applies, see the Clone entries in Methods Cross-Reference.

CloneOption | Description
cloneMajorChildren | Clone the values of properties and all major and minor objects contained in the source object’s collections.
cloneMinorChildren | Clone the values of the properties and the minor objects contained in the source object’s collections.
cloneObjectProperties | Clone the values of the properties of the source object.

Note The CustomProperties collection is always cloned, regardless of the CloneOption specified.


CommandTypes

Enumerates values for the CommandType property. For more information about objects and interfaces to which this property applies, see the CommandType entries in Properties Cross-Reference.

CommandType | Description
cmdCreateMember | Defines one or more calculated members.
cmdCreateSet | Defines one or more named sets of existing members.
cmdUseLibrary | Specifies DLLs containing functions to be registered for use in MDX expressions. A user could write a DLL containing some special statistical functions, register this DLL with a USE LIBRARY command, and then run queries using these statistical functions.
cmdUnknown | Defines statements not included in any of the above command types, such as DROP MEMBER statements or new statements that may be added to future versions.


DimensionAggUsageTypes

Enumerates values for the AggregationUsage property. For more information about objects and interfaces to which this property applies, see the AggregationUsage entries in Properties Cross-Reference.

AggregationUsage | Description
dimAggUsageCustom | Create aggregations for dimension levels as specified by level.
dimAggUsageDetailsOnly | Create aggregations on only the lowest level in the dimension.
dimAggUsageStandard | Create aggregations as determined by the aggregation design algorithm.
dimAggUsageTopOnly | Create aggregations only for the top (All) level.


DimensionTypes

Enumerates values for the DimensionType property. For more information about objects and interfaces to which this property applies, see the DimensionType entries in Properties Cross-Reference.

DimensionType | Description
dimQuantitative | Reserved for future use.
dimTime | Indicates that a dimension refers to time (year, month, week, day, and so forth). The only valid levels in a time dimension are those that begin with “levTime” as defined in LevelTypes enumeration.
dimRegular | The default dimension type, used for any dimension that is not time-related.


ErrorCodes

Enumerates error codes. Use this enumerator to determine the meaning of a returned error code.

ErrorCode | Description
mderrAggregationUsageNotCustom | The EnableAggregations property cannot be set for levels in dimensions whose AggregationUsage property is not dimAggUsageCustom.
mderrBadParameterForServiceState | Invalid service state parameter on the computer.
mderrCannotAddVirtualDimension | Cannot add a virtual dimension because its source dimension is not in the database.
mderrCannotCloneObjectIntoItself | Cannot clone an object into itself.
mderrCannotCommitDatabase | Unable to create a database on the OLAP server.
mderrCannotCreatePartition | No system partition is available for this operation . System partitions have been programmatically defined as user partitions. User-defined partitions are available only if you install Microsoft® SQL Server™ OLAP Services, Enterprise Edition.
mderrCannotDeleteDimension | A dimension cannot be deleted because it is used in a cube.
mderrCannotDeleteLast Partition | Cannot delete the last partition in a cube. (A cube must have at least one partition.)
mderrCannotDeleteLevel | Cannot delete a level if it is used in a virtual dimension.
mderrCannotDeleteMemberProperty | Cannot delete a member property if it is used in a virtual dimension.
mderrCannotModify SharedObject | Cannot change a property of a shared dimension (or subordinate level) used in a cube.
mderrCannotRemoveMeasureFromDefaultAggregation | Cannot remove a measure from an aggregation created by PartitionAnalyzer.
mderrCannotRenameObject | Only temporary objects can be renamed.
mderrCannotSaveInsideTransaction | Cannot save object inside a Decision Support Objects (DSO) transaction.
mderrCollectionItem NotFound | Raised if you try to remove an item from a collection that does not exist in the collection.
mderrCollectionReadOnly | Cannot add an object to, or remove an object from, a collection that is read-only.
mderrCouldNotLockObject | Raised if you try to lock an object that is already locked (by someone else).
mderrCouldNotOpen Service | The OLAP server runs as a Microsoft Windows NT® service. This error is raised if the service could not be opened. For more information about the CouldNotOpenService error, see the Microsoft Win32® API Programmer’s Reference.
mderrCouldNotOpen ServiceControlManager | The OLAP server runs as a Windows NT service. This error is raised if the service control manager could not be opened. For more information about the CouldNotOpenServiceControlManager error, see the Microsoft Win32 API Programmer’s Reference.
mderrCouldNotQuery TheService | The OLAP server runs as a Windows NT service. This error is raised if the service could not be queried. For more information about the CouldNotQueryTheService error, see the Microsoft Win32 API Programmer’s Reference.
mderrDifferentAggregationDatasources | Partitions cannot be merged because source and target partitions have different relational data sources.
mderrDifferentAggregationNumber | Partitions cannot be merged because source and target partitions have different number of aggregations.
mderrDifferentAggregationOLAPMode | Partitions cannot be merged because source and target partitions have different storage modes.
mderrDifferentAggregationStructure | Partitions cannot be merged because source and target partitions have different structures or storage modes.
mderrDimensionLocked ByCube | Dimension is locked because it is currently being used in a cube. Remove the dimension from the cube to unlock the dimension.
mderrDimensionNotIn UnderlyingCubes | Cannot add to a virtual cube a dimension that is not in any of the cubes on which the virtual cube is based.
mderrDuplicateKeyIn Collection | Cannot add to a collection an item with the same name as an item already in the collection.
mderrIllegalObjectName | Cannot assign an illegal name to an object.
mderrInvalidLockType | Invalid LockType argument value.
mderrInvalidParent | An object that is not a member of a collection has no parent.
mderrInvalidPropertySetting | Cannot add an object to, or remove an object from, a collection that is read-only.
mderrLockAccessError | Unable to lock an object already locked.
mderrLockCannotBeObtained | Unable to obtain a lock from the server.
mderrLockDescriptionTooLong | Lock description is longer than permitted.
mderrLockFileCorrupted | The server reported that the lock file is corrupted.
mderrLockFileMissing | The server reported that the lock file is missing.
mderrLockNetworkDown | Network error.
mderrLockNetworkNameNotFound | Cannot find name on the network.
mderrLockNetworkPathNotFound | Cannot find this network path.
mderrLockObjectNotLocked | Cannot unlock an object that is not locked.
mderrLockSystemError | A lock cannot be obtained because of an unknown error.
mderrMeasureDoesNot HaveValidSourceColumn | Cannot add a measure to a virtual cube if the name of the measure's source column is not in the correct format.
mderrNameCannotBeChanged | Cannot change a DSO object name unless the object is a temporary object.
mderrNameCannotBeEmpty | An object cannot have an empty name.
mderrObjectChangedByAnotherApp | Cannot save object because it was not locked and was changed by another object.
mderrObjectIsNotWrite Locked | Cannot update an object that is not write-locked.
mderrPropertyCannotBeChanged | Property cannot be changed in this context.
mderrRepositoryConnectionFailed | Object repository may be read-only.
mderrRepositoryIncompatible | Repository is incompatible with this version of DSO.
mderrSourceDoesNotExist | Cannot merge partitions - source partition does not exist.
mderrTargetDoesNotExist | Cannot merge partitions - target partition does not exist.
mderrTooManyLevelsIn Dimension | The maximum number of levels in a dimension is 64 (63 plus the All level).
mderrUnsuccesfullServiceOperation | The OLAP server service (MSSQLServerOLAPService) is not running on the specified computer.


LevelTypes

Enumerates values for the LevelType property. For more information about objects and interfaces to which this property applies, see the LevelType entries in Properties Cross-Reference.

LevelType | Description
levAll | Specifies the top (All) level of a dimension (the one that aggregates all the members of all lower levels).
levRegular | Specifies that the level is not related to time.
levTimeDays | Specifies that a level refers to days. Must be used in a dimension whose type is dimTime.
levTimeHalfYears | Specifies that a level refers to half-years. Must be used in a dimension whose type is dimTime.
levTimeHours | Specifies that a level refers to hours. Must be used in a dimension whose type is dimTime.
levTimeMinutes | Specifies that a level refers to minutes. Must be used in a dimension whose type is dimTime.
levTimeMonths | Specifies that a level refers to months. Must be used in a dimension whose type is dimTime.
levTimeQuarters | Specifies that a level refers to (calendar) quarters. Must be used in a dimension whose type is dimTime.
levTimeSeconds | Specifies that a level refers to seconds. Must be used in a dimension whose type is dimTime.
levTimeWeeks | Specifies that a level refers to weeks. Must be used in a dimension whose type is dimTime.
levTimeYears | Specifies that a level refers to years. Must be used in a dimension whose type is dimTime.


OlapEditions

Enumerates values for the Edition property of objects of ClassType clsServer. For more information about objects and interfaces to which this method applies, see the Edition entries in Methods Cross-Reference.

Edition | Description
olapEditionUnlimited | The OLAP server supports full functionality.
olapEditionPivotOnly | Reserved for future use.
olapEditionNoPartitions | The OLAP server does not support user-defined partitions.
olapEditionError | The edition of the OLAP server cannot be determined.


OlapLockTypes

Enumerates values for the LockType parameter of the LockObject method. For more information about objects and interfaces to which this method applies, see the LockObject entries in Methods Cross-Reference. For more information about the LockObject method, see MDStore Interface.

LockType | Description
olapLockExtendedRead | The object’s properties can be read by other applications, but cannot be changed or processed.
olapLockProcess | The object’s Process method can be initiated, and other applications can only read the object's properties until the lock is released.
olapLockRead | The properties of the object can be read from the repository and cannot be changed by another application until the lock is released.
olapLockWrite | The properties of the object can be modified in the repository using the Update method, and are not available to other applications for any use until the lock is released.


OlapStateTypes

Enumerates values for the State property for objects other than server objects. For information about objects and interfaces to which this property applies, see the State entries in Properties Cross-Reference. For information about the ServerStates enumeration, see ServerStates.

State | Description
olapStateCurrent | The state of the object is current.
olapStateMemberPropertiesChanged | Member properties of the object have changed.
olapStateNeverProcessed | The object has never been processed.
olapStateSourceMappingChanged | The source mapping for the object has changed.
olapStateStructureChanged | The object’s structure has changed.


OlapStorageModes

Enumerates values for the OlapMode property. For more information about objects and interfaces to which this property applies, see the OlapMode entries in Properties Cross-Reference.

OlapMode | Description | Applies to
olapmodeAggsMolapIndex | Reserved for future use. | n/a
olapmodeAggsRolap | Reserved for future use. | n/a
olapmodeHybridIndex | Facts in ROLAP, aggregations in MOLAP. | Databases, cubes, and partitions (excluding virtual cubes).
olapmodeMolapIndex | Facts in MOLAP, aggregations in MOLAP. | Databases, cubes, and partitions (excluding virtual cubes).
olapmodeRolap | Facts in ROLAP, aggregations in ROLAP. | Databases, cubes, and partitions (excluding virtual cubes).

For more information, see the OlapMode property in MDStore Interface.


OrderTypes

Enumerates values for the Ordering property. For information about objects and interfaces to which this property applies, see the Ordering entries in Properties Cross-Reference.

State | Description
orderKey | Order members in MemberKeyColumn sequence.
orderName | Order members in MemberNameColumn sequence.


ProcessTypes

Enumerates values for the Option parameter of the Process method. For more information about objects and interfaces to which this method applies, see the Process entries in Methods Cross-Reference.

Option | Description
processBuildStructure Applies only to cubes. Processing a cube ordinarily causes the OLAP server to read all source data corresponding to the definition of the cube, create the cube, and populate it with data.

This option causes the OLAP server to create the cube (that is, build its structure) but not populate it with data. Instead, the cube exists as an empty shell on the server. A user can connect to the cube, but it contains no data.

This option can have performance benefits. If you don’t use the option (see processDefault), the partitions in a cube are processed sequentially. If you do use it, you can process the partitions in parallel, using a different process for each partition.

processDefault | The default option. Causes the system to decide what processing method is best. Typically this means that the system will try to refresh the object’s data (processRefreshData) unless its structure has changed or it no longer exists. In the latter case, the system will perform a full processing (processFull).
processFull | Causes the object to be fully processed or rebuilt. The object’s structure is changed if needed and its data is refreshed (that is, discarded and repopulated). This is the most complete type of processing supported. See processRefreshData.
processRefreshData | Causes the object data to be refreshed (that is, discarded and repopulated), but does not change the object’s structure. This operation occurs inside a transaction, allowing you to continue using current data while the transaction takes place. When the transaction is committed, the new data is available. See processFull.
processResume | Directs the OLAP server to resume responding to user queries against a cube that has had queries suspended. The OLAP server will automatically resume responding to queries after 60 seconds unless processResume is received first.
processSuspend | Directs the OLAP server to suspend responses to user queries against a cube so your application can perform operations such as merging fact tables. The OLAP server automatically resumes responding to queries after 60 seconds (earlier if you submit a processResume request).


ServerStates

Enumerates values for the State property of server objects. For information about the server object to which this property applies, see clsServer.

State | Description
stateConnected | The attempt to connect to the server succeeded.
stateFailed | The attempt to connect to the server failed.
stateUnknown | The application has disconnected from the server or has not yet connected to the server.


SubClassTypes

Enumerates values for the SubClassType property. For information about objects and interfaces to which this property applies, see the SubClassType entries in Properties Cross-Reference.

SubClassType | Description | Applies to
sbclsRegular | Indicates that the object is a regular object. | All objects
sbclsVirtual | Indicates that the object is a virtual cube. | clsCube
sbclsVirtual | Indicates that the object is a virtual level in a virtual dimension. | clsPartitionLevel clsCubeLevel clsDatabaseLevel

For more information about virtual cubes, see Virtual Cubes. For more information about virtual levels, see Level Interface.


Methods Cross-Reference

The following table lists the methods exposed in the various objects within the OLAP server.

Method | Applies to | Interface | Description
Add | Collections | n/a | Adds an existing object to a collection.
Add | CustomProperties | n/a | Adds a Property object to a CustomProperties collection.
AddNew | Collections | n/a | Creates and adds a new object to a collection.
AddExistingAggregation | clsPartitionAnalyzer | n/a | Adds an existing aggregation to the DesignedAggregations collection.
AddGoalQuery | clsPartitionAnalyzer | n/a | Adds a particular query that is to be optimized.
BeginTrans | clsDatabase | MDStore | Begins the transaction on the database.
Clear | CustomProperties | n/a | Clears all Property objects from a CustomProperties collection.
Clone | clsDatabaseCommand | Command | Copies an existing object to a target object of the same class type.
Clone | clsDatabaseDimension | Dimension | Creates a copy of the database dimension.
Clone | clsAggregation clsCube clsDatabase clsPartition | MDStore | Creates and returns a copy of an MDStore object.
Clone | clsDatabaseRole | Role | Creates a copy of a database role.
Clone | clsDatasource | n/a | Copies a clsDatasource object to another clsDatasource object.
CloseAggregationAnalysis | clsPartitionAnalyzer | n/a | Closes this clsPartitionAnalyzer session and clears out the objects used during the analysis.
CloseServer | clsServer | n/a | Releases all server resources and sets the object’s State to stateUnknown.
CommitTrans | clsDatabase | MDStore | Commits the transaction on the database.
Connect | clsServer | n/a | Connects to an OLAP server service (MSSQLServerOLAPService).
CreateObject | clsServer | n/a | Creates an object.
Find | CustomProperties | n/a | Retrieves a Property object from a CustomProperties collection.
InitializeDesign | clsPartitionAnalyzer | n/a | Checks the partition structure to ensure that clsPartitionAnalyzer can be run and initializes the objects necessary to perform the analysis.
IsConnected | clsDatasource | n/a | Connects to a data source. Returns True if connected; False if unable to connect.
Item | Collections |  | Locates an item in a collection.
Item | CustomProperties |  | Returns an instance of an item in the collection.
LockObject | clsDatabaseCommand | Command | Locks an object.
LockObject | clsDatasource | n/a | Locks a clsDatasource object.
LockObject | clsDatabaseDimension | Dimension | Locks the database dimension.
LockObject | clsCube clsDatabase clsPartition | MDStore | Locks an object.
LockObject | clsDatabaseRole | Role | Locks an object.
LockObject | clsServer | n/a | Requests the OLAP server lock a specified object.
Merge | clsPartition | MDStore | Merges two partitions.
NextAnalysisStep | clsPartitionAnalyzer | n/a | Adds new aggregations to the DesignedAggregations collection and calculates the incremental performance gained versus additional aggregation storage requirements.
OpenQueryLogRecordset | clsCubeAnalyzer | n/a | Open a query log recordset.
PrepareGoalQueries | clsPartitionAnalyzer | n/a | Prepares the GoalQueries that were entered using the AddGoalQuery method for use in this analysis session.
Process | clsDatabaseDimension | Dimension | Processes a dimension.
Process | clsCube clsDatabase clsPartition | MDStore | Processes a store.
Refresh | clsServer | n/a | Reads all current metadata from the repository and modifies all objects in the object model of a session to match the current repository state.
Remove | Collections | n/a | Removes an object from a collection.
Remove | CustomProperties | n/a | Removes a Property object from a CustomProperties collection.
Rollback | clsDatabase | MDStore | Rolls back the transaction on the database.
SetPermissions | clsCubeRole | Role | Sets the permissions for a cube role for a given key.
UnlockAllObjects | clsServer | n/a | Unlocks all previously locked objects.
UnlockObject | clsDatabaseCommand | Command | Unlocks a previously locked object.
UnlockObject | clsDatabaseDimension | Dimension | Unlocks a previously locked object.
UnlockObject | clsCube clsDatabase clsPartition | MDStore | Unlocks a previously locked object.
UnlockObject | clsDatasource | n/a | Unlocks a previously locked clsDatasource object.
UnlockObject | clsServer | n/a | Unlocks a previously locked object.
UnlockObject | clsDatabaseRole | Role | Unlocks a previously locked object.
Update | clsDatabaseCommand | Command | Updates the database command's definition in the metadata repository.
Update | clsDatasource | n/a | Updates the clsDatasource object definition in the metadata repository.
Update | clsDatabaseDimension | Dimension | Updates the definition of the database dimension in the metadata repository.
Update | clsCube clsDatabase clsPartition | MDStore | Updates an object definition in the metadata repository.
Update | clsServer | n/a | Updates an object definition in the metadata repository.
Update | clsDatabaseRole | Role | Updates the definition of the database role in the metadata repository.


Properties Cross-Reference

The following table lists the properties exposed by various objects in Microsoft® SQL Server™ OLAP Services version 7.0. Different interfaces may implement a property in slightly different ways.

There is no explicit class for virtual cube dimensions, levels, or measures. If a property does not apply to a virtual cube dimension, level, or measure, that fact is noted in the Applies to column.

Property | Applies to | Interface | Description
AggregateFunction | clsAggregationMeasure clsCubeMeasure clsPartitionMeasure | Measure | A value corresponding to the type of aggregation function used for a measure.
AggregationAnalysisInitialized | clsPartitionAnalyzer | n/a | Indicates whether the partition analyzer has been initialized.
AggregationPrefix | clsAggregation clsCube clsDatabase clsPartition | MDStore | Prefix associated with an aggregation in the store.
AggregationUsage | clsCubeDimension clsPartitionDimension | Dimension | Specifies how aggregations are to be designed for a dimension.
Analyzer | clsCube (excluding virtual cubes) clsPartition | MDStore | The analyzer object for the store.
Caption | clsMemberProperty | n/a | A label associated with the member property to be used for display purposes by OLAP clients.
ClassType | clsCubeCommand clsDatabaseCommand | Command | An enumeration constant identifying the specific class type.
ClassType | Collections | n/a | The class type of the collection object.
ClassType | clsDataSource | n/a | An enumeration constant identifying the specific class type.
ClassType | clsAggregationDimension clsCubeDimension clsDatabaseDimension clsPartitionDimension | Dimension | An enumeration constant identifying the specific class type.
ClassType | clsAggregationLevel clsCubeLevel clsDatabaseLevel clsPartitionLevel | Level | An enumeration constant identifying the specific class type.
ClassType | clsAggregation clsCube clsDatabase clsPartition | MDStore | An enumeration constant identifying the specific class type.
ClassType | clsAggregationMeasure clsCubeMeasure clsPartitionMeasure | Measure | An enumeration constant identifying the specific class type.
ClassType | clsMemberProperty | n/a | An enumeration constant identifying the specific class type.
ClassType | clsCubeRole clsDatabaseRole | Role | An enumeration constant identifying the specific class type.
ClassType | clsServer | n/a | An enumeration constant identifying the specific class type.
CloseQuoteChar | clsDatasource | n/a | The right (closing) quote character used by the source database.
ColumnSize | clsAggregationLevel clsCubeLevel clsDatabaseLevel clsPartitionLevel | Level | Size of the level aggregation column in an aggregation table.
ColumnType | clsAggregationLevel clsCubeLevel clsDatabaseLevel clsPartitionLevel | Level | Data type of the level aggregation column in an aggregation table.
CommandType | clsCubeCommand clsDatabaseCommand | Command | An enumeration constant identifying the command option.
Connection | clsDatasource | n/a | A reference to a Microsoft ActiveX® Data Objects (ADO) Connection object, used to connect to a relational database.
ConnectionString | clsDatasource | n/a | A string containing the initialization parameters for the source database.
ContainedClassType | Collections | n/a | The class type of the items contained within the collection.
Count | Collections | n/a | The number of items in a collection.
Count | CustomProperties | n/a | The number of Property objects in a CustomProperties collection.
DataSource | clsAggregationDimension clsCubeDimension (excluding virtual objects) clsDatabaseDimension (excluding virtual objects) clsPartitionDimension (excluding virtual objects) | Dimension | The data source object of a dimension object.
DataType | Property | n/a | The Microsoft Visual Basic® data type of the custom property defined by the Property object.
Description | clsCubeCommand clsDatabaseCommand | Command | The description of the command object.
Description | clsDatasource | n/a | The description of the data source.
Description | clsCubeDimension clsDatabaseDimension clsPartitionDimension | Dimension | The description of the dimension.
Description | clsAggregationLevel clsCubeLevel clsDatabaseLevel clsPartitionLevel | Level | The description of the level.
Description | clsAggregation clsCube clsDatabase clsPartition | MDStore | The description of the store.
Description | clsAggregationMeasure clsCubeMeasure clsPartitionMeasure | Measure | The description of the measure.
Description | clsMemberProperty | n/a | The description of the member property.
Description | clsCubeRole clsDatabaseRole | Role | The description of the role.
Description | clsServer | n/a | The description of the server.
DimensionType | clsAggregationDimension clsCubeDimension clsDatabaseDimension clsPartitionDimension | Dimension | An enumeration constant identifying the specific type of dimension.
Edition | clsServer | n/a | The edition of the installed OLAP Services.
EnableAggregations | clsCubeLevel clsPartitionLevel | Level | Specifies whether aggregations are to be enabled for the level object.
EstimatedRows | clsAggregation clsCube clsPartition | MDStore | The estimated number of rows in the store.
EstimatedSize | clsAggregationLevel clsCubeLevel clsDatabaseLevel clsPartitionLevel | Level | The estimated number of members in the level.
EstimatedSize | clsAggregation clsCube clsDatabase clsPartition | MDStore | The estimated size of all rows, in bytes, in the store.
FormatString | clsAggregationMeasure clsCubeMeasure clsPartitionMeasure | Measure | The format used to display the measure values.
FromClause | clsAggregationDimension clsCubeDimension clsDatabaseDimension clsPartitionDimension | Dimension | The SQL FROM clause for the dimension.
FromClause | clsAggregationLevel clsCubeLevel clsDatabaseLevel clsPartitionLevel | Level | The SQL FROM clause for the level.
FromClause | clsAggregation clsCube (excluding virtual cubes) clsPartition | MDStore | The SQL FROM clause for the store.
IsDefault | clsAggregation clsPartition | MDStore | Indicates whether the store is the default store.
IsDisabled | clsAggregationLevel clsCubeLevel clsPartitionLevel | Level | Indicates whether the level is disabled. Disabled levels are not visible to end users when browsing a cube.
IsInternal | clsAggregationMeasure clsCubeMeasure clsPartitionMeasure | Measure | Indicates whether the measure is internal to the cube, that is, it is used only for calculations of other measures.
IsReadOnly | clsDatasource | n/a | Indicates whether the data source is read-only.
IsReadWrite | clsCube clsDatabase clsPartition | MDStore | Indicates whether the MDStore object is writable.
IsShared | clsAggregationDimension clsCubeDimension clsDatabaseDimension clsPartitionDimension | Dimension | Indicates whether the dimension can be shared among cubes.
IsTemporary | clsAggregationDimension clsCubeDimension clsDatabaseDimension clsPartitionDimension | Dimension | Indicates whether the object is temporary.
IsTemporary | clsAggregation clsCube clsPartition | MDStore | Indicates whether the object is temporary.
IsUnique | clsAggregationLevel clsCubeLevel clsDatabaseLevel clsPartitionLevel | Level | Indicates whether all members for a level are uniquely identified by the member key column alone.
IsValid | clsCubeCommand clsDatabaseCommand | Command | Indicates whether the Name and Statement properties are empty and that the command object belongs to a collection.
IsValid | clsDatasource | n/a | Indicates whether the structure of the data source object is valid.
IsValid | clsAggregationDimension clsCubeDimension clsDatabaseDimension clsPartitionDimension | Dimension | Indicates whether the dimension structure is valid.
IsValid | clsAggregationLevel clsCubeLevel clsDatabaseLevel clsPartitionLevel | Level | Indicates whether the level structure is valid.
IsValid | clsAggregation clsCube clsDatabase clsPartition | MDStore | Indicates whether the store object is valid.
IsValid | clsAggregationMeasure clsCubeMeasure clsPartitionMeasure | Measure | Indicates whether the measure object is valid.
IsValid | clsCubeRole clsDatabaseRole | Role | Indicates whether the role structure is valid.
IsValid | clsServer | n/a | Indicates whether the server settings are valid.
JoinClause | clsAggregationDimension clsCubeDimension clsDatabaseDimension clsPartitionDimension | Dimension | The SQL JOIN clause for the dimension.
JoinClause | clsAggregationLevel clsCubeLevel clsDatabaseLevel clsPartitionLevel | Level | The SQL JOIN clause for the level.
JoinClause | clsAggregation clsCube (excluding virtual cubes) clsPartition | MDStore | The SQL JOIN clause for the store.
LastProcessed | clsAggregationDimension clsCubeDimension clsDatabaseDimension clsPartitionDimension | Dimension | The date and time when the dimension was last processed.
LastProcessed | clsAggregation clsCube clsDatabase clsPartition | MDStore | The date and time when the store was last processed.
LastUpdated | clsAggregationDimension clsCubeDimension clsDatabaseDimension clsPartitionDimension | Dimension | User-specified date. Not used by OLAP Services.
LastUpdated | clsAggregation clsCube clsDatabase clsPartition | MDStore | User-specified date. Not used by OLAP Services.
LevelType | clsAggregationLevel clsCubeLevel clsDatabaseLevel clsPartitionLevel | Level | An enumeration constant identifying the specific type of level.
LockTimeout | clsServer | n/a | The amount of time until a lock request fails due to timeout.
MemberKeyColumn | clsAggregationLevel clsCubeLevel clsDatabaseLevel clsPartitionLevel | Level | The name of the column or expression that contains member keys.
MemberNameColumn | clsAggregationLevel clsCubeLevel clsDatabaseLevel clsPartitionLevel | Level | The name of the column or expression that contains member names.
Name | clsCubeCommand clsDatabaseCommand | Command | The name of the command object.
Name | clsDatasource | n/a | The name of the data source.
Name | clsAggregationDimension clsCubeDimension clsDatabaseDimension clsPartitionDimension | Dimension | The name of the dimension.
Name | clsAggregationLevel clsCubeLevel clsDatabaseLevel clsPartitionLevel | Level | The name of the level.
Name | clsAggregation clsCube clsDatabase clsPartition | MDStore | The name of the store.
Name | clsAggregationMeasure clsCubeMeasure clsPartitionMeasure | Measure | The name of the measure.
Name | clsMemberProperty | n/a | The name of the member property.
Name | Property | n/a | The unique user-assigned name of the custom property defined by the Property object.
Name | clsCubeRole clsDatabaseRole | Role | The name of the role.
Name | clsServer | n/a | The name of the server.
OlapMode | clsAggregation clsCube (excluding virtual cubes) clsDatabase clsPartition | MDStore | An enumeration constant identifying the type of OLAP mode of the store.
OpenQuoteChar | clsDatasource | n/a | The left (opening) quote character used by the source database.
Ordering | clsAggregationLevel clsCubeLevel clsDatabaseLevel clsPartitionLevel | Level | Specifies how a level should be ordered.
OrdinalPosition | clsCubeCommand clsDatabaseCommand | Command | The position of the command relative to other commands.
OrdinalPosition | clsAggregationDimension clsCubeDimension clsDatabaseDimension clsPartitionDimension | Dimension | The position of the dimension relative to other dimensions.
OrdinalPosition | clsAggregationLevel clsCubeLevel clsDatabaseLevel clsPartitionLevel | Level | The position of the level relative to other levels.
OrdinalPosition | clsAggregationMeasure clsCubeMeasure clsPartitionMeasure | Measure | The position of the measure relative to other measures.
OrdinalPosition | clsMemberProperty | n/a | The ordinal position of the MemberProperty object in the MemberProperties collection.
Parent | clsCubecommand clsDatabaseCommand | Command | The parent MDStore object.
Parent | clsDatasource | n/a | The parent MDStore object.
Parent | clsAggregationDimension clsCubeDimension clsDatabaseDimension clsPartitionDimension | Dimension | The parent MDStore object.
Parent | clsAggregationLevel clsCubeLevel clsDatabaseLevel clsPartitionLevel | Level | The parent Dimension object.
Parent | clsAggregation clsCube clsDatabase clsPartition | MDStore | The parent MDStore object.
Parent | clsAggregationMeasure clsCubeMeasure clsPartitionMeasure | Measure | The parent MDStore object.
Parent | clsMemberProperty | n/a | The parent Level object.
Parent | clsPartitionAnalyzer | n/a | Contains a reference to the parent MDStore (ClassType clsPartition) object.
Parent | clsCubeRole clsDatabaseRole | Role | The parent MDStore object.
Parent | clsServer | n/a | Contains a reference to the App object.
Permissions | clsCubeRole | Role | The role permissions for the specific key.
Server | clsAggregation clsCube clsDatabase clsPartition | MDStore | The DSO.Server object.
ServiceState | clsServer | n/a | Contains the state of the OLAP server service (MSSQLServer OLAPService).
SliceValue | clsPartitionLevel | Level | The name of the level member used to define a partition slice.
SourceColumn | clsAggregationMeasure clsCubeMeasure clsPartitionMeasure | Measure | The name of the column in the measure fact table that is aggregated.
SourceColumn | clsMemberProperty | n/a | The dimension table name and column that contains values for the MemberProperty.
SourceColumnType | clsAggregationMeasure clsCubeMeasure clsPartitionMeasure | Measure | The measure source column data type.
SourceTable | clsCubeDimension clsDatabaseDimension clsPartitionDimension | Dimension | The name of the source table for the dimension.
SourceTable | clsAggregation clsCube clsPartition | MDStore | The name of the source table of a store.
SourceTableFilter | clsCube (excluding virtual cubes) clsPartition | MDStore | The SQL statement that specifies the source table records to included in the store.
Statement | clsCubeCommand clsDatabaseCommand | Command | The text of the command statement.
State | clsAggregationDimension clsDatabaseDimension | Dimension | Indicates the difference between the dimension object referenced by the client application and the corresponding dimension on the OLAP server.
State | clsCube clsDatabase clsPartition | MDStore | Indicates the difference between the MDStore object referenced by the client application and the corresponding MDStore object on the OLAP server.
State | clsServer | n/a | Indicates the status of the connection to the OLAP server.
SubClassType | clsCubeCommand clsDatabaseCommand | Command | An enumeration constant identifying the subclass type of the object.
SubClassType | clsDatasource | n/a | An enumeration constant identifying the subclass type of the object.
SubClassType | clsAggregationDimension clsCubeDimension clsDatabaseDimension clsPartitionDimension | Dimension | An enumeration constant identifying the subclass type of the object.
SubClassType | clsAggregationLevel clsCubeLevel clsDatabaseLevel clsPartitionLevel | Level | An enumeration constant identifying the subclass type of the object.
SubClassType | clsAggregation clsCube clsDatabase clsPartition | MDStore | An enumeration constant identifying the subclass type of the object.
SubClassType | clsAggregationMeasure clsCubeMeasure clsPartitionMeasure | Measure | An enumeration constant identifying the subclass type of the object.
SubClassType | clsMemberProperty | n/a | An enumeration constant identifying the subclass type of the object.
SubClassType | clsCubeRole clsDatabaseRole | Role | An enumeration constant identifying the subclass type of the object.
SupportedTxnDDL | clsDatasource | n/a | The value of the connection object’s Transaction DDL (data definition language) property, which indicates the source database’s ability to support DDL statements in transactions.
Timeout | clsServer | n/a | The amount of time until a timeout error occurs during processing.
UsersList | clsCubeRole clsDatabaseRole | Role | A semicolon-delimited list of users.
Value | Property | n/a | Can contain any value that is valid for the DataType defined for the Property object.


Using Decision Support Objects

You can use Decision Support Objects (DSO) in your applications to control the server and create and maintain OLAP objects. For information about the programming environments in which you can use DSO to create applications, see Programming Environment.

A common sequence of operations for an application using DSO is to:

  • Connect to an OLAP server.
  • Create a database object to contain dimensions and cubes.
  • Add a datasource that contains the data.
  • Create dimensions and their levels.
  • Create a cube and specify dimensions and measures.
  • Process a cube to load its structure and data.

These operations are described and illustrated using Microsoft® Visual Basic® code in Creating a Sample Program Using Decision Support Objects.

Considerations when using Decision Support Objects

When creating a program using Microsoft® SQL Server™ OLAP Services Decision Support Objects (DSO) there are certain limitations that must be observed when naming DSO objects. The following table lists characters that are not allowed.

Object | Invalid Characters
Server | Same as Microsoft Windows NT®
DataSource | : / \ * | ? " () [] {} <>
Level | . , ; ' ` : / \ * | ? " & % $ ! - + = [] {}
Dimension | , ; ' ` : / \ * | ? " & % $ ! - + = () [] {}
Other Objects | . , ; ' ` : / \ * | ? " & % $ ! - + = () [] {}

Note All DSO object names must begin with a letter. A dimension name may contain a single dot (.) within the name. This dot serves to separate the dimension name from the hierarchy name. For example, in “MyDim.Hier1” and “MyDim.Hier2”, “MyDim” is a dimension with two hierarchies, “Hier1” and “Hier2”.


Creating a Sample Program Using Decision Support Objects

The topics in this section provide information in a tutorial format that shows you how to create a sample client application using the Decision Support Objects (DSO) object model. If you work through these exercises in order, you will create a project in Microsoft® Visual Basic® that performs the following functions:

  • Connects to your OLAP server.
  • Accesses the FoodMart sample database.
  • Adds a new database and datasource.
  • Adds dimensions and levels.
  • Adds a cube and measures.
  • Processes the cube.

Note You can also find sample applications on the SQL Server CD-ROM in the folder ..\MSOLAP\Samples that illustrate some of the techniques for developing your own applications that use DSO or PivotTable® Service. The Readme.txt file in the folder provides descriptions of the individual samples and instructions on installing them to your computer. Examples include displaying metadata and data over the Web, creating and processing cubes with DSO, creating a write-enabled cube, and more.

The example uses these functions to create a cube derived from the FoodMart sample database, which is provided with Microsoft SQL Server™ OLAP Services. It uses the Sales_Fact_1998, Product, Store, and Time_By_Day tables in a star schema with the following joins and characteristics:

  • Sales_Fact_1998.Product_id is joined to Product.Product_id
  • Sales_Fact_1998.Store_id is joined to Store.Store_id
  • Sales_Fact_1998.Time_id is joined to Time_By_Day.time_id

The dimension and measures for this cube are listed here:

  • Dimension: Products
    • Level: Brand Name
    • Level: Product Name
  • Dimension: Store
    • Level: Store Type
    • Level: Store Id
    • Level: Store Name
  • Dimension: Time
    • Level: Year
    • Level: Quarter
    • Level: Month
    • Level: Week
  • Measure: Product Id
  • Measure: Store Sales
  • Measure: Store Cost
  • Measure: Unit Sales

Note In order to complete these exercises, you must have configured your computer according to the instructions contained in Programming Environment.

Remarks

These exercises assume that you have some experience in creating Visual Basic applications.

You may also find it helpful to review the structure of the FoodMart database itself by examining it either in Microsoft Access or in a third-party computer-aided software engineering (CASE) tool. This will help you to understand how the preceding steps are applied to the specific instance of the FoodMart database.

Some of these exercises modify the FoodMart sample database. We recommend you make backup copies of the following directories before you proceed:

  • ..\OLAP Services\Bin
  • ..\OLAP Services\Data

To complete your Visual Basic project, step through the exercises in order. Start with Connect to a Server.


Connect to a Server

The example code in this section shows you how to connect to an OLAP server and list some of its property values. You must complete this section before moving on to subsequent examples.

Begin a new Microsoft® Visual Basic® project. Be sure to add Microsoft Decision Support Objects and Microsoft ActiveX® Data Objects to the program references.

Add the following to the Declarations section of the form:

Option Explicit

Public dsoServer As DSO.Server

Public dsoDB As DSO.MDStore

Public dsoCube As DSO.MDStore

In the Form_Load section add the following code:

Private Sub Form_Load()

    On Error GoTo FormLoad_Err

    Dim intClassType As Integer

    Dim strClassType As String

    'Initialize global objects

    Set dsoDB = Nothing

    Set dsoCube = Nothing

    'Create instance of server and connect.

    '"LocalHost" will default to the

    'local Windows NT Server where the

    'OLAP server is installed.

    Set dsoServer = New DSO.Server

    dsoServer.Connect ("LocalHost")

    'Get the class type and describe it.

    intClassType = dsoServer.ClassType

    Select Case intClassType

        Case clsServer

            strClassType = "Server"

        Case Else

            strClassType = "Invalid Class Type"

    End Select

    'Show the server’s information to the user.

    Debug.Print "Server Properties:"

    Debug.Print "Name: " & dsoServer.Name

    Debug.Print "ClassType: " & dsoServer.ClassType

    Debug.Print "Description: " & dsoServer.Description

    Debug.Print "machine: " & dsoServer.Machine

    Exit Sub

FormLoad_Err:

    Debug.Print "Error connecting to server"

    Debug.Print Err.Number, Err.Description, Err.Source

    Err.Clear

    Debug.Assert False

End Sub

If the OLAP server is not installed on the computer on which you are running this example, change “LocalHost” to the name of the Microsoft Windows NT® Server computer where the OLAP server is installed and running.

Save your project and run the application. Check the output in the Immediate window to confirm that your server has been successfully initialized.

Next

Create a Database


Create a Database

Each OLAP server contains an MDStores collection of databases, that is, objects of ClassType clsDatabase. A database in Decision Support Objects (DSO) contains dimensions and their subordinate levels, data sources, roles, and commands. Each database also contains an MDStores collection of cubes, that is, objects of ClassType clsCube.

In the following examples, you will add functionality to list databases associated with a server, as well as create and remove a database.

List Databases

Add a command button to the form named cmdListDatabases. Add the following code to the cmdListDatabases_Click() event:

Private Sub cmdListDatabases_Click()

    Dim dsoTempDB As DSO.MDStore

    Dim Counter As Integer

    'For each database on the server, print its name.

    For Counter = 1 To dsoServer.MDStores.Count

        Set dsoTempDB = dsoServer.MDStores(Counter)

        Debug.Print "Database: " & dsoTempDB.Name & _

        " / " & dsoTempDB.Description

    Next Counter

End Sub

Save your project and run the application. The Immediate window lists each database name and description. At this point, the only database in the system should be the FoodMart sample database.

Create a Database

To create an object of ClassType clsDatabase on your server, add a command button to the form named cmdAddDatabase. Add the following code to the cmdAddDatabase_Click() event:

Private Sub cmdAddDatabase_Click()

    On Error GoTo AddDatabase_Err

    'Declare and allocate local string variables

    'for use by the MDStore object.

    Dim strDBName As String

    Dim strDBDesc As String

    'Ask the user for a name for the database

    strDBName = InputBox("Enter a Unique DB Name", _

    "Adding New Database")

    'Is this new database name blank?

    If strDBName = "" Then

        MsgBox ("You must enter a database name")

        Exit Sub

    End If

    'Is there already a database by this name?

    If dsoServer.MDStores.Find(strDBName) Then

        MsgBox (strDBName & " already exists")

        Exit Sub

    End If

    'Add new database to server object collection

    'Using the AddNew method from MDStores.

    Set dsoDB = dsoServer.MDStores.AddNew(strDBName)

    'Ask the user for a description for the new database

    strDBDesc = InputBox("Enter a Description", _

    "Adding New Database")

    'Assign this description to the MDStore’s

    'Description property, and call the Update method.

    dsoDB.Description = strDBDesc

    dsoDB.Update

    'Inform the user that the database was added to the server.

    MsgBox (strDBName & " added to server " & dsoServer.Name)

    Exit Sub

AddDatabase_Err:

    Debug.Print "Error adding new Database"

    Debug.Print Err.Number, Err.Description, Err.Source

    Err.Clear

End Sub

Save your project and run the application. Click Add Database, and then enter a unique name in the text box. Use the List Database button created in the previous example to verify that the new database has been added.

Remove a Database

To remove a database, add a command button to the form named cmdRemoveDatabase. Add the following code to the cmdRemoveDatabase_Click() event:

Private Sub cmdRemoveDatabase_Click()

    Dim strDBName

    Dim bResult As Boolean

    'Do we have a database

    If dsoDB Is Nothing Then

        strDBName = InputBox("Database to remove.", _

        "Remove Database")

        If strDBName = "" Then

            MsgBox ("You must enter the name of a Database")

            Exit Sub

        End If

        'If the database can’t be found, inform the user.

        If Not dsoServer.MDStores.Find(strDBName) Then

            MsgBox (strDBName & "database not found on this server")

            Exit Sub

        Else

            Set dsoDB = dsoServer.MDStores(strDBName)

        End If

    End If

    'Ask users if they are sure they want to delete this DB

    bResult = MsgBox("Are you sure you want to remove " & dsoDB.Name, _

    vbYesNo, "Remove Database")

    If bResult = True Then

        strDBName = dsoDB.Name

        dsoServer.MDStores.Remove strDBName

        Set dsoDB = Nothing

        MsgBox (strDBName & "removed from server" & dsoServer.Name)

    Else

        MsgBox ("Canceled - Database not removed")

    End If

End Sub

Save your project and run the application. Try removing the database you created using the previous example.

Next

Add a Data Source


Add a Data Source

Collections of data sources, that is, objects of ClassType clsDatasource, are contained in objects of ClassType clsDatabase, clsCube, and clsPartition. Each object’s data source specifies an external database that will be used as the source of data.

A database can contain multiple data sources in its DataSources collection. Each cube and partition, however, contains only a single data source.

The two examples in this section demonstrate how to list and add a data source to the database’s DataSources collection.

List Data Sources

Add a command button to the form called cmdListDatasources. Add the following code to the cmdListDatasources_Click() event:

Private Sub cmdListDatasources_Click()

    Dim dsoTempDB As DSO.MDStore

    Dim dsoDS As DSO.DataSource

    Dim DBCounter As Integer

    Dim DSCounter As Integer

 'Step through the databases in the server's MDStores collection

    For DBCounter = 1 To dsoServer.MDStores.Count

        Set dsoTempDB = dsoServer.MDStores(DBCounter)

        'Step through the data sources in the database's DataSources

        'collection

        Debug.Print "DATABASE: " & dsoTempDB.Name & " / " & _

        dsoTempDB.Description

        If dsoTempDB.DataSources.Count = 0 Then

            Debug.Print "      Datasource: None"

        Else

            For DSCounter = 1 To dsoTempDB.DataSources.Count

               Set dsoDS = dsoTempDB.DataSources(DSCounter)

               Debug.Print "      Datasource: " & dsoDS.Name

               Debug.Print "  Connect String: " & dsoDS.ConnectionString

            Next DSCounter

        End If

    Next DBCounter

End Sub

Save your project and run the application. At this point, you should see None listed for the datasource for any new database you add to the system.

Add a Datasource

Add a command button to the form named cmdAddDatasource. Add the following code to the cmdAddDatasource_Click() event:

Private Sub cmdAddDatasource_Click()

    On Error GoTo AddDatasource_Err

    Dim dsoDS As DSO.DataSource

    Dim strDBName As String

    Dim bResult As Boolean

    Dim strConnect As String

    Const strProvider = "Provider=MSDASQL.1;"

    Const strSecurity = "Persist Security Info=False;"

    Const strDataSrc = "Data Source=FoodMart;"

    Const strTimeOut = "Connect Timeout=15"

    Const strDSName = "FoodMart"

    'Do we have a database?

    If dsoDB Is Nothing Then

        strDBName = InputBox("Database to add new DataSource to.", _

        "Add Datasource")

        If strDBName = "" Then

            MsgBox ("You must enter the name of a Database")

            Exit Sub

        End If

        'Does this database exist?

        If Not dsoServer.MDStores.Find(strDBName) Then

            MsgBox (strDBName & " database not found on this server")

            Exit Sub

        Else

            Set dsoDB = dsoServer.MDStores(strDBName)

        End If

    End If

    'Does database already have an attached datasource?

    If dsoDB.DataSources.Count >= 1 Then

        strDBName = dsoDB.Name

       MsgBox (strDBName & " database already has a datasource " & strDSName & " attached")

       Exit Sub

    End If

    'Ask the user to confirm adding the Datasource

    bResult = MsgBox("Add FoodMart Datasource", vbOKCancel, _

    "Add Datasource")

    If bResult = True Then

        Set dsoDS = dsoDB.DataSources.AddNew(strDSName)

       'Build the connection string

        strConnect = strProvider & strSecurity & strDataSrc

        strConnect = strConnect & strDataSrc & strTimeOut

        'Set datasource properties

        dsoDS.Name = strDSName

        dsoDS.ConnectionString = strConnect

        dsoDS.Update

        MsgBox ("Datasource added to " & dsoDB.Name)

    Else

        MsgBox ("Canceled - no Datasource added")

    End If

    Exit Sub

AddDatasource_Err:

    Debug.Print "Error attaching new datasource"

    Debug.Print Err.Number, Err.Description, Err.Source

    Err.Clear

End Sub

Save your project and run the application. Try adding a datasource. Verify that the datasource has been successfully added by listing datasources.

Note Since we are using the FoodMart sample database for these exercises, the data source name and connection string are hard coded. To add a different data source you will need to provide the correct data source name and connection string information.

Next

Add Dimensions and Levels


Add Dimensions and Levels

The dimensions of a cube store data derived from relational database tables and contain the categorical data you want to analyze.

The dimensions you build (for example, time, customer education, and customer age) should be distinct categories you want to add to cubes in your database. A dimension can be created from a single dimension table (star schema) or from multiple dimension tables (snowflake schema). Dimensions are classified as either standard or time dimensions, depending upon the data type of the corresponding column in the dimension table.

Collections of dimensions are contained within objects of ClassType clsDatabase, clsCube, clsPartition, and clsAggregation. The dimension objects contained within each of these collections are of respective ClassTypes clsDatabaseDimension, clsCubeDimension, clsPartitionDimension, and clsAggregationDimension.

The List Dimension example (below) lists existing dimensions and their related levels. The Add Dimensions example creates new dimensions and levels.

List Dimension

Add a command button to the form named cmdListDimensions. Add the following code to the cmdListDimensions_Click() event:

Private Sub cmdListDimensions_Click()

    Dim dsoTempDB As DSO.MDStore

    Dim dsoDim As DSO.Dimension

    Dim dsoLev As DSO.Level

    Dim DBCounter As Integer

    Dim DimCounter As Integer

    Dim LevCounter As Integer

    'Step through the databases in the server's MDStores collection

    For DBCounter = 1 To dsoServer.MDStores.Count

        Set dsoTempDB = dsoServer.MDStores(DBCounter)

        Debug.Print "DATABASE: " & dsoTempDB.Name & " / " & _

        dsoTempDB.Description

        'Step through the dimensions in the cube's Dimensions collection

        For DimCounter = 1 To dsoTempDB.Dimensions.Count

            Set dsoDim = dsoTempDB.Dimensions(DimCounter)

            Debug.Print "    Dimension: " & dsoDim.Name

            'Step through dimension levels

            For LevCounter = 1 To dsoDim.Levels.Count

                Set dsoLev = dsoDim.Levels(LevCounter)

                Debug.Print "        Level: " & dsoLev.Name

            Next LevCounter

        Next DimCounter

    Next DBCounter

End Sub

Save your project and run the application. The Immediate window will list the dimensions and levels for each database.

Add Dimensions

Add a command button to the form named cmdAddDimensions. Add the following code to the cmdAddDimensions_Click() event:

Private Sub cmdAddDimensions_Click()

    On Error GoTo AddDimension_Err

    Dim dsoDS As DSO.DataSource

    Dim dsoDim As DSO.Dimension

    Dim dsoLev As DSO.Level

    Dim strDBName As String

    Dim strCubeName As String

    Dim strMsg As String

    Dim bResponse As VbMsgBoxResult

    Dim DimCounter As Integer

    'Do we have a database?

    If dsoDB Is Nothing Then

        strDBName = InputBox("Database to add dimensions to.", _

        "Add Dimensions - Database")

        If strDBName = "" Then

            MsgBox ("You must enter the name of a Database")

            Exit Sub

        End If

        If Not dsoServer.MDStores.Find(strDBName) Then

            MsgBox (strDBName & " database not found on this server")

            Exit Sub

        Else

            Set dsoDB = dsoServer.MDStores(strDBName)

        End If

    End If

    'We must have a datasource for the database

    If dsoDB.DataSources.Count = 0 Then

        MsgBox ("Please add a Datasource")

        Exit Sub

    Else

        Set dsoDS = dsoDB.DataSources(1)

    End If

    strMsg = "Create Dimensions and Levels for database " & dsoDB.Name

    bResponse = MsgBox(strMsg, vbOKCancel, "Add Dimensions and Levels")

    'Add shared dimensions to Database

    If bResponse = vbOK Then

        'Create Product Dimension and Levels

        Set dsoDim = dsoDB.Dimensions.AddNew("Products")

        Set dsoDim.DataSource = dsoDS   'Dimension DataSource

        dsoDim.FromClause = "product"   'Related Table

        dsoDim.JoinClause = ""          'Used in snowflake schema

        'Product Brand Level

        Set dsoLev = dsoDim.Levels.AddNew("Brand Name")

        dsoLev.MemberKeyColumn = """product"".""brand_name"""

        dsoLev.ColumnSize = 255

        dsoLev.ColumnType = adWChar

        dsoLev.EstimatedSize = 1

        'Product Name Level

        Set dsoLev = dsoDim.Levels.AddNew("Product Name")

        dsoLev.MemberKeyColumn = """product"".""product_name"""

        dsoLev.ColumnSize = 255

        dsoLev.ColumnType = adWChar

        dsoLev.EstimatedSize = 1

        'Update the dimension

        dsoDim.Update

        'Create Store Dimension and Levels

        Set dsoDim = dsoDB.Dimensions.AddNew("Store")

        Set dsoDim.DataSource = dsoDS   'Dimension DataSource

        dsoDim.FromClause = "store"     'Related Table

        dsoDim.JoinClause = ""

        'Store Type Level

        Set dsoLev = dsoDim.Levels.AddNew("Store Type")

        dsoLev.MemberKeyColumn = """store"".""store_type"""

        dsoLev.ColumnSize = 255

        dsoLev.ColumnType = adWChar

        dsoLev.EstimatedSize = 1

        'Store Id Level

        Set dsoLev = dsoDim.Levels.AddNew("Store Id")

        dsoLev.MemberKeyColumn = """store"".""store_id"""

        dsoLev.ColumnSize = 4

        dsoLev.ColumnType = adInteger

        dsoLev.EstimatedSize = 1

        'Store Name Level

        Set dsoLev = dsoDim.Levels.AddNew("Store Name")

        dsoLev.MemberKeyColumn = """store"".""store_name"""

        dsoLev.ColumnSize = 255

        dsoLev.ColumnType = adWChar

        dsoLev.EstimatedSize = 1

        'Update the dimension

        dsoDim.Update

        'Create Time Dimension and Levels

        Set dsoDim = dsoDB.Dimensions.AddNew("Time")

        Set dsoDim.DataSource = dsoDS

        dsoDim.FromClause = "time_by_day"

        dsoDim.JoinClause = ""

        'Year Level

        Set dsoLev = dsoDim.Levels.AddNew("Year")

        dsoLev.MemberKeyColumn = _

        "DatePart('yyyy',""time_by_day"".""the_date"")"

        dsoLev.ColumnSize = 10

        dsoLev.ColumnType = 2

        dsoLev.EstimatedSize = 1

        'Quarter Level

        Set dsoLev = dsoDim.Levels.AddNew("Quarter")

        dsoLev.MemberKeyColumn = _

        "DatePart('q',""time_by_day"".""the_date"")"

        dsoLev.ColumnSize = 4

        dsoLev.ColumnType = adSmallInt

        dsoLev.EstimatedSize = 1

        'Month Level

        Set dsoLev = dsoDim.Levels.AddNew("Month")

        dsoLev.MemberKeyColumn = _

        "DatePart('m',""time_by_day"".""the_date"")"

        dsoLev.ColumnSize = 4

        dsoLev.ColumnType = adSmallInt

        dsoLev.EstimatedSize = 1

        'Week Level

        Set dsoLev = dsoDim.Levels.AddNew("Week")

        dsoLev.MemberKeyColumn = _

        "Format(""time_by_day"".""the_date"",'medium date')"

        dsoLev.ColumnSize = 20

        dsoLev.ColumnType = adChar

        dsoLev.EstimatedSize = 1

        'Update the dimension

        dsoDim.Update

        'Tell the user it was successful.

        MsgBox ("Dimension and Levels added")

    Else

        MsgBox ("Canceled - No dimensions added")

    End If

    Exit Sub

AddDimension_Err:

    Debug.Print "Error adding new dimension"

    Debug.Print Err.Number, Err.Description, Err.Source

    Err.Clear

End Sub

Save your project and run the application. Try adding dimensions and levels. Verify that the dimensions and levels have been successfully added by listing dimensions and levels.

Note Since we are using the FoodMart sample database for these exercises, the information for dimension names, FromClause, and MemberKeyColumn are hard coded. To add other dimension/level data you will need to provide the proper information for specific properties.

Next

Add a Cube


Add a Cube

Each database contains an MDStores collection of cubes, that is, objects of ClassType clsCube. A cube is the central object in a multidimensional database. A cube contains dimensions and their levels, measures, data sources, roles, and commands. Each cube also contains an MDStores collection of partitions, that is, objects of ClassType clsPartition.

In the previous examples you created a new database and added a datasource along with shared dimensions and levels. The following three examples in this topic demonstrate the steps required to list, add, and remove a cube.

List Cubes

Add a command button to the form named cmdListCubes. Add the following code to the cmdListCubes_Click() event:

Private Sub cmdListCubes_Click()

    Dim dsoTempDB As DSO.MDStore

    Dim dsoTempCube As DSO.MDStore

    Dim DBCounter As Integer

    Dim CubeCounter As Integer

    'Step through the databases in the server's MDStores collection

    For DBCounter = 1 To dsoServer.MDStores.Count

        Set dsoTempDB = dsoServer.MDStores(DBCounter)

        Debug.Print "DATABASE: " & dsoTempDB.Name & " / " & _

        dsoTempDB.Description

        'Step through the cubes in the database's MDStores collection

        If dsoTempDB.MDStores.Count = 0 Then

            Debug.Print "  Cube: None"

        Else

            For CubeCounter = 1 To dsoTempDB.MDStores.Count

                Set dsoTempCube = dsoTempDB.MDStores(CubeCounter)

                Debug.Print "  Cube: " & dsoTempCube.Name

                'Inform the user whether this cube is regular

                'Or virtual.

                If dsoTempCube.SubClassType = sbclsRegular Then

                   Debug.Print "       SubClassType: Regular"

                   Debug.Print "        SourceTable: " & _

                     dsoTempCube.SourceTable

                Else

                    Debug.Print "       SubClassType: Virtual"

                End If

             Next CubeCounter

        End If

    Next DBCounter

End Sub

Save your project and run the application. Try listing the cubes.

Add a Cube

In the following example, we will add a cube to the MDStores collection of the database using these steps:

  1. Add the cube to the MDStores collection of the database by using its AddNew method.
  2. Add a data source to the newly created cube.
  3. Set the SourceTable property of the cube and estimate the number of rows in this table in the EstimatedRows property.
  4. Add the shared dimensions (that were created in the previous section) to the cube’s Dimensions collection by using the AddNew method of that collection.
  5. Create a JOIN clause for connecting the dimension table to the source table, and then assign it to the cube’s JoinClause property.
  6. Make the changes to this cube permanent by calling the cube’s Update method.

Add a command button to the form named cmdAddCube. Add the following code to the cmdAddCube_Click() event:

Private Sub cmdAddCube_Click()

    On Error GoTo AddCube_Err

    Dim dsoDS As DSO.DataSource

    Dim strDBName As String

    Dim strCubeName As String

    'Do we have a database?

    If dsoDB Is Nothing Then

        strDBName = InputBox("Database to add new Cube to.", _

        "Add Cube")

        If strDBName = "" Then

            MsgBox ("You must enter the name of a Database")

            Exit Sub

        End If

        If Not dsoServer.MDStores.Find(strDBName) Then

            MsgBox (strDBName & " database not found on this server")

            Exit Sub

        Else

            Set dsoDB = dsoServer.MDStores(strDBName)

        End If

    End If

    'Does database have an attached datasource?

    If dsoDB.DataSources.Count = 0 Then

        MsgBox ("Please attach Datasource to Database")

        Exit Sub

    End If

    'Does database have Dimensions and Levels?

    If dsoDB.Dimensions.Count = 0 Then

        MsgBox ("Please add Dimensions to Database")

        Exit Sub

    End If

    'Enter Cube Name and check for duplicate

    strCubeName = InputBox("Enter the new cube name.", _

    "Adding New Cube")

    If strCubeName <> "" Then

        If dsoDB.MDStores.Find(strCubeName) Then

            MsgBox (strCubeName & " already exists")

            Exit Sub

        End If

    End If

    'Create new Cube

    Set dsoCube = dsoDB.MDStores.AddNew(strCubeName)

    'Set the cube's DataSource

    Set dsoDS = dsoDB.DataSources(1)

    dsoCube.DataSources.AddNew (dsoDS.Name)

    'Set source Fact Table and Estimated Rows in Fact Table

    dsoCube.SourceTable = """sales_fact_1998"""

    dsoCube.EstimatedRows = 100000

    'Add shared dimensions that were created under

    'cmdAddDimensions_Click method

    dsoCube.Dimensions.AddNew ("Products")

    dsoCube.Dimensions.AddNew ("Store")

    dsoCube.Dimensions.AddNew ("Time")

    'Create joins between Fact Table and Dimension tables

    'Set strJoin = “sales_fact_1998.product_id = product.product_id AND

    '               sales_fact_1998.store_id = store.store_id AND

    '               sales_fact_1998.time_id = time_by_day.time_id”

    Dim strJoin As String

    'Fact Table to Product Table join

    'sales_fact_1998.product_id = product.product_id

    strJoin = "(""sales_fact_1998"".""product_id""=""product"".""product_id"")"

    strJoin = strJoin & " AND "

    'Fact Table to Store Table join

    'sales_fact_1998.store_id = store.store_id

    strJoin = strJoin & "(""sales_fact_1998"".""store_id""=""store"".""store_id"")"

    strJoin = strJoin & " AND "

    'Fact Table to Time Table join

    'sales_fact_1998.time_id = time_by_day.time_id

    strJoin = strJoin & "(""sales_fact_1998"".""time_id""=""time_by_day"".""time_id"")"

    dsoCube.JoinClause = strJoin

    'Update the cube

    dsoCube.Update

    MsgBox (strCubeName & " and Dimensions added")

    Exit Sub

AddCube_Err:

    Debug.Print "Error adding new cube"

    Debug.Print Err.Number, Err.Description, Err.Source

    Err.Clear

End Sub

Save your project and run the application. Click Add Cube, and then enter a unique name for the new cube. Verify that the cube was added by listing cubes.

Remove a Cube

Add a command button to the form named cmdRemoveCube. Add the following code to the cmdRemoveCube_Click() event:

Private Sub cmdRemoveCube_Click()

    On Error GoTo RemoveCube_Err

    Dim strDBName As String

    Dim strCubeName As String

     'Do we have a database?

    If dsoDB Is Nothing Then

        strDBName = InputBox("Database to remove cube from.", _

        "Remove Cube")

        If strDBName = "" Then

            MsgBox ("You must enter the name of a Database")

            Exit Sub

        End If

        If Not dsoServer.MDStores.Find(strDBName) Then

            MsgBox (strDBName & " database not found on this server")

            Exit Sub

        Else

            Set dsoDB = dsoServer.MDStores(strDBName)

        End If

    End If

   ' Do we have a cube?

   If dsoCube Is Nothing Then

        strCubeName = InputBox("Enter the name of the cube to be removed.", _

        "Removing Cube")

        If strCubeName = "" Then

            MsgBox ("You must enter the name of a cube to remove")

            Exit Sub

        End If

        If Not dsoDB.MDStores.Find(strCubeName) Then

            MsgBox (strCubeName & " cube not found on this database")

            Exit Sub

        Else

            Set dsoCube = dsoDB.MDStores(strCubeName)

        End If

        dsoDB.MDStores.Remove strCubeName

        MsgBox (strCubeName & " removed")

    End If

    Exit Sub

RemoveCube_Err:

    Debug.Print "Error removing cube"

    Debug.Print Err.Number, Err.Description, Err.Source

    Err.Clear

End Sub

Save your project and run the application. Try removing the cube. Verify that the cube has been removed by listing cubes.

Next

Add Measures


Add Measures

Collections of measures are contained within objects of ClassType clsCube, clsPartition, and clsAggregation. The measure objects contained within each of these collections are of respective ClassTypes clsCubeMeasure, clsPartitonMeasure, and clsAggregationMeasure.

The following examples demonstrate how to list and add new measures to the sample cube you’ve created.

List Measures

Add a command button to the form named cmdListMeasures. Add the following code to the cmdListMeasures_Click() event:

Private Sub cmdListMeasures_Click()

    Dim dsoTempDB As DSO.MDStore

    Dim dsoTempCube As DSO.MDStore

    Dim dsoMea As DSO.Measure

    Dim strDBName As String

    Dim strCubeName As String

    Dim DBCounter As Integer

    Dim CubeCounter As Integer

    Dim MeaCounter As Integer

    'Step through the databases in the server's MDStores collection

    For DBCounter = 1 To dsoServer.MDStores.Count

        Set dsoTempDB = dsoServer.MDStores(DBCounter)

        Debug.Print "DATABASE: " & dsoTempDB.Name & " / " & _

        dsoTempDB.Description

        'Step through the cubes in the database collection

        For CubeCounter = 1 To dsoTempDB.MDStores.Count

            Set dsoTempCube = dsoTempDB.MDStores(CubeCounter)

            Debug.Print "    Cube: " & dsoTempCube.Name

            'Step thorough measures for the cube

            For MeaCounter = 1 To dsoTempCube.Measures.Count

                Set dsoMea = dsoTempCube.Measures(MeaCounter)

                Debug.Print "        Measure: " & dsoMea.Name

            Next MeaCounter

        Next CubeCounter

    Next DBCounter

End Sub

Save your project and run the application. The Immediate window lists each cube and its related measures.

Add Measures

Add a command button to the form named cmdAddMeasures. Add the following code to the cmdAddMeasures_Click() event:

Private Sub cmdAddMeasures_Click()

    On Error GoTo AddMeasures_Err

    Dim dsoDS As DSO.DataSource

    Dim dsoMea As DSO.Measure

    Dim bResponse As VbMsgBoxResult

    Dim strDBName As String

    Dim strCubeName As String

    'Do we have a database?

    If dsoDB Is Nothing Then

        strDBName = InputBox("Database to add dimension measures to.", _

        "Add Dimension Measures - Database")

        If strDBName = "" Then

            MsgBox ("You must enter the name of a Database")

            Exit Sub

        End If

        If Not dsoServer.MDStores.Find(strDBName) Then

            MsgBox (strDBName & " database not found on this server")

            Exit Sub

        Else

            Set dsoDB = dsoServer.MDStores(strDBName)

        End If

    End If

    'We must have a datasource for the database

    If dsoDB.DataSources.Count = 0 Then

        MsgBox ("Please add a Datasource")

        Exit Sub

    Else

        Set dsoDS = dsoDB.DataSources(1)

    End If

     'Do we have existing Database Dimensions?

    If dsoDB.Dimensions.Count = 0 Then

        MsgBox ("Please add dimensions to Database")

        Exit Sub

    End If

   'Do we have a cube?

   If dsoCube Is Nothing Then

        strCubeName = InputBox("Enter the name of the cube in this database.", _

        "Add Dimension Measures - Cube")

        If strCubeName = "" Then

            MsgBox ("You must enter the name of a cube.")

            Exit Sub

        End If

        If Not dsoDB.MDStores.Find(strCubeName) Then

            MsgBox (strCubeName & " cube not found on this database")

            Exit Sub

        Else

            Set dsoCube = dsoDB.MDStores(strCubeName)

        End If

    End If

    'Ask the user to confirm adding the measures to the cube.

    bResponse = MsgBox("Add Measures for Cube Dimensions", _

    vbOKCancel, "Add Cube Measures")

    'Add the measures to the cube.

    If bResponse = vbOK Then

        Set dsoMea = dsoCube.Measures.AddNew("Product Id")

        dsoMea.SourceColumn = """sales_fact_1998"".""product_id"""

        dsoMea.SourceColumnType = adSmallInt

        dsoMea.AggregateFunction = aggSum

        Set dsoMea = dsoCube.Measures.AddNew("Store Sales")

        dsoMea.SourceColumn = """sales_fact_1998"".""store_sales"""

        dsoMea.SourceColumnType = adSmallInt

        dsoMea.AggregateFunction = aggSum

        Set dsoMea = dsoCube.Measures.AddNew("Store Cost")

        dsoMea.SourceColumn = """sales_fact_1998"".""store_cost"""

        dsoMea.SourceColumnType = adSmallInt

        dsoMea.AggregateFunction = aggSum

        Set dsoMea = dsoCube.Measures.AddNew("Unit Sales")

        dsoMea.SourceColumn = """sales_fact_1998"".""unit_sales"""

        dsoMea.SourceColumnType = adSmallInt

        dsoMea.AggregateFunction = aggSum

        dsoCube.Update

        MsgBox ("Measures added")

    Else

        MsgBox ("Canceled - no measures added")

        Exit Sub

    End If

    Exit Sub

AddMeasures_Err:

    Debug.Print "Error adding new measures"

    Debug.Print Err.Number, Err.Description, Err.Source

    Err.Clear

End Sub

Save your project and run the application. Click Add Measures. Verify that the measures have been added to the cube by listing measures.

Next

Process a Cube


Process a Cube

A database, shared dimensions and their levels, and a cube and its measures are now in place and the cube can be processed.

Add a final command button to the form named cmdProcess. Add the following code to the cmdProcess_Click() event:

Private Sub cmdProcess_Click()

    Dim strDBName As String

    Dim strCubeName As String

    Dim bResponse As VbMsgBoxResult

    'Do we have a database?

    If dsoDB Is Nothing Then

        strDBName = InputBox("Enter name of Database with cube to process.", "Process Cube")

        If strDBName = "" Then

            MsgBox ("You must enter the name of a Database")

            Exit Sub

        End If

        If Not dsoServer.MDStores.Find(strDBName) Then

            MsgBox (strDBName & " database not found on this server")

            Exit Sub

        Else

            Set dsoDB = dsoServer.MDStores(strDBName)

        End If

    End If

    'Does the Database have an attached Datasource?

    If dsoDB.DataSources.Count = 0 Then

        MsgBox ("Please attach a Datasource")

        Exit Sub

    End If

    'Do we have Dimensions and Levels?

    If dsoDB.Dimensions.Count = 0 Then

        MsgBox ("Please add Dimensions and Levels to Database")

        Exit Sub

    End If

   'Do we have a cube?

   If dsoCube Is Nothing Then

        strCubeName = InputBox("Enter the name of the cube to process.", "Process Cube")

        If strCubeName = "" Then

            MsgBox ("You must enter the name of a cube to process")

            Exit Sub

        End If

        If Not dsoDB.MDStores.Find(strCubeName) Then

            MsgBox (strCubeName & " cube not found in this database")

            Exit Sub

        Else

            Set dsoCube = dsoDB.MDStores(strCubeName)

        End If

    End If

    'Does cube have measures?

    If dsoCube.Measures.Count = 0 Then

        MsgBox ("Please add Measures to cube")

        Exit Sub

    End If

    'Everything should be in place for processing the cube

    bResponse = MsgBox("Processing Cube may take some time - Proceed?", _

    vbYesNo, "Process Cube")

    If bResponse = vbYes Then

        dsoCube.Process

        MsgBox ("Complete - Use OLAP Manager to browse data")

    End If

    Exit Sub

ProcessCube_Err:

    Debug.Print "An error occurred processing the cube"

    Debug.Print Err.Number, Err.Description, Err.Source

    Err.Clear

End Sub

Save your project and run the application. Click Process. You may be prompted for the name of the database and cube to process. Enter the name of the database and cube you created in the previous steps.

Processing the cube can take several minutes. You can view the cube data using the OLAP Manager after processing is complete.